powerlines 0.42.32 → 0.42.34

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 (122) hide show
  1. package/dist/api-0aKfs398.mjs +1010 -0
  2. package/dist/api-0aKfs398.mjs.map +1 -0
  3. package/dist/api-7bOKZ8DC.cjs +1030 -0
  4. package/dist/{api-context-k3dnn5KR.cjs → api-context-4t-rlsAr.cjs} +64 -442
  5. package/dist/{api-context-BQi9M07D.mjs → api-context-CmuOyg7q.mjs} +62 -432
  6. package/dist/api-context-CmuOyg7q.mjs.map +1 -0
  7. package/dist/astro.mjs.map +1 -1
  8. package/dist/{chunk-7azAqIA9.cjs → chunk-AIJqnxB6.cjs} +0 -7
  9. package/dist/{chunk-WJdhOJK3.mjs → chunk-CtajNgzt.mjs} +1 -10
  10. package/dist/config.cjs +1 -1
  11. package/dist/config.mjs +1 -1
  12. package/dist/constants.cjs +1 -1
  13. package/dist/constants.mjs +1 -1
  14. package/dist/context/index.cjs +1 -1
  15. package/dist/context/index.d.cts +11 -260
  16. package/dist/context/index.d.cts.map +1 -1
  17. package/dist/context/index.d.mts +12 -261
  18. package/dist/context/index.d.mts.map +1 -1
  19. package/dist/context/index.mjs +1 -1
  20. package/dist/esbuild.cjs +9 -4
  21. package/dist/esbuild.d.cts +2 -2
  22. package/dist/esbuild.d.cts.map +1 -1
  23. package/dist/esbuild.d.mts +2 -2
  24. package/dist/esbuild.d.mts.map +1 -1
  25. package/dist/esbuild.mjs +2 -2
  26. package/dist/esbuild.mjs.map +1 -1
  27. package/dist/farm.cjs +1 -1
  28. package/dist/index.cjs +3 -3
  29. package/dist/index.d.cts +1 -1
  30. package/dist/index.d.mts +2 -2
  31. package/dist/index.mjs +2 -2
  32. package/dist/next.mjs.map +1 -1
  33. package/dist/nuxt.cjs +2 -2
  34. package/dist/nuxt.d.mts +1 -1
  35. package/dist/nuxt.mjs +1 -1
  36. package/dist/nuxt.mjs.map +1 -1
  37. package/dist/plugin-utils.cjs +1 -1
  38. package/dist/plugin-utils.mjs +1 -1
  39. package/dist/rolldown.cjs +7 -2
  40. package/dist/rolldown.d.cts +2 -2
  41. package/dist/rolldown.d.cts.map +1 -1
  42. package/dist/rolldown.d.mts +2 -2
  43. package/dist/rolldown.d.mts.map +1 -1
  44. package/dist/rolldown.mjs +2 -2
  45. package/dist/rolldown.mjs.map +1 -1
  46. package/dist/rollup.cjs +7 -2
  47. package/dist/rollup.d.cts +2 -2
  48. package/dist/rollup.d.cts.map +1 -1
  49. package/dist/rollup.d.mts +2 -2
  50. package/dist/rollup.d.mts.map +1 -1
  51. package/dist/rollup.mjs +2 -2
  52. package/dist/rollup.mjs.map +1 -1
  53. package/dist/rspack.cjs +7 -2
  54. package/dist/rspack.d.cts +2 -2
  55. package/dist/rspack.d.cts.map +1 -1
  56. package/dist/rspack.d.mts +2 -2
  57. package/dist/rspack.d.mts.map +1 -1
  58. package/dist/rspack.mjs +2 -2
  59. package/dist/rspack.mjs.map +1 -1
  60. package/dist/storage/index.cjs +1 -1
  61. package/dist/storage/index.d.cts +1 -1
  62. package/dist/storage/index.d.mts +2 -2
  63. package/dist/storage/index.mjs +1 -1
  64. package/dist/ts-morph-B85ZbV1Q.mjs +102 -0
  65. package/dist/ts-morph-B85ZbV1Q.mjs.map +1 -0
  66. package/dist/ts-morph-Cf4wz3E0.cjs +114 -0
  67. package/dist/{tsconfig-BhVGZ2DK.cjs → tsconfig-ChmbpAO7.cjs} +2 -2
  68. package/dist/{tsconfig-CzYPBpDS.mjs → tsconfig-DoV1dUYg.mjs} +2 -2
  69. package/dist/{tsconfig-CzYPBpDS.mjs.map → tsconfig-DoV1dUYg.mjs.map} +1 -1
  70. package/dist/tsdown.cjs +8 -3
  71. package/dist/tsdown.d.cts +2 -2
  72. package/dist/tsdown.d.cts.map +1 -1
  73. package/dist/tsdown.d.mts +2 -2
  74. package/dist/tsdown.d.mts.map +1 -1
  75. package/dist/tsdown.mjs +3 -3
  76. package/dist/tsdown.mjs.map +1 -1
  77. package/dist/tsup.cjs +8 -3
  78. package/dist/tsup.d.cts +3 -547
  79. package/dist/tsup.d.cts.map +1 -1
  80. package/dist/tsup.d.mts +3 -547
  81. package/dist/tsup.d.mts.map +1 -1
  82. package/dist/tsup.mjs +3 -3
  83. package/dist/tsup.mjs.map +1 -1
  84. package/dist/{types-hdziyQIH.d.mts → types-9O-s0Fpu.d.mts} +1 -1
  85. package/dist/types-9O-s0Fpu.d.mts.map +1 -0
  86. package/dist/typescript/index.cjs +4 -104
  87. package/dist/typescript/index.d.cts +1 -6
  88. package/dist/typescript/index.d.cts.map +1 -1
  89. package/dist/typescript/index.d.mts +2 -7
  90. package/dist/typescript/index.d.mts.map +1 -1
  91. package/dist/typescript/index.mjs +3 -102
  92. package/dist/unloader.cjs +1 -1
  93. package/dist/unplugin.cjs +2 -2
  94. package/dist/unplugin.mjs +1 -1
  95. package/dist/utils.cjs +1 -1
  96. package/dist/utils.mjs +1 -1
  97. package/dist/{virtual-BHb4iMd_.cjs → virtual-BNy8T32w.cjs} +3 -3
  98. package/dist/{virtual-OEHgBu0s.mjs → virtual-PaZGNIrj.mjs} +3 -3
  99. package/dist/{virtual-OEHgBu0s.mjs.map → virtual-PaZGNIrj.mjs.map} +1 -1
  100. package/dist/vite.cjs +7 -2
  101. package/dist/vite.d.cts +2 -2
  102. package/dist/vite.d.mts +2 -2
  103. package/dist/vite.mjs +2 -2
  104. package/dist/vite.mjs.map +1 -1
  105. package/dist/webpack.cjs +7 -2
  106. package/dist/webpack.d.cts +2 -2
  107. package/dist/webpack.d.cts.map +1 -1
  108. package/dist/webpack.d.mts +2 -2
  109. package/dist/webpack.d.mts.map +1 -1
  110. package/dist/webpack.mjs +2 -2
  111. package/dist/webpack.mjs.map +1 -1
  112. package/package.json +14 -13
  113. package/dist/api-D6i8MmbC.mjs +0 -6063
  114. package/dist/api-D6i8MmbC.mjs.map +0 -1
  115. package/dist/api-DZoRNTY7.cjs +0 -6083
  116. package/dist/api-context-BQi9M07D.mjs.map +0 -1
  117. package/dist/base-Bl_AMAlI.d.cts +0 -12
  118. package/dist/base-Bl_AMAlI.d.cts.map +0 -1
  119. package/dist/base-hjCHfNY6.d.mts +0 -12
  120. package/dist/base-hjCHfNY6.d.mts.map +0 -1
  121. package/dist/types-hdziyQIH.d.mts.map +0 -1
  122. package/dist/typescript/index.mjs.map +0 -1
@@ -1,10 +1,10 @@
1
- const require_chunk = require('./chunk-7azAqIA9.cjs');
1
+ const require_chunk = require('./chunk-AIJqnxB6.cjs');
2
2
  const require_utils = require('./utils.cjs');
3
3
  const require_plugin_utils = require('./plugin-utils.cjs');
4
4
  const require_constants = require('./constants.cjs');
5
- const require_tsconfig = require('./tsconfig-BhVGZ2DK.cjs');
5
+ const require_tsconfig = require('./tsconfig-ChmbpAO7.cjs');
6
6
  const require_config = require('./config.cjs');
7
- const require_virtual = require('./virtual-BHb4iMd_.cjs');
7
+ const require_virtual = require('./virtual-BNy8T32w.cjs');
8
8
  let _stryke_fs_get_workspace_root = require("@stryke/fs/get-workspace-root");
9
9
  let _stryke_convert_to_array = require("@stryke/convert/to-array");
10
10
  let _stryke_fs_exists = require("@stryke/fs/exists");
@@ -23,17 +23,12 @@ let _stryke_type_checks_is_set = require("@stryke/type-checks/is-set");
23
23
  let _stryke_type_checks_is_set_object = require("@stryke/type-checks/is-set-object");
24
24
  let _stryke_type_checks_is_set_string = require("@stryke/type-checks/is-set-string");
25
25
  let _stryke_type_checks_is_string = require("@stryke/type-checks/is-string");
26
- let node_process = require("node:process");
27
- node_process = require_chunk.__toESM(node_process);
28
- let node_os = require("node:os");
29
- node_os = require_chunk.__toESM(node_os);
30
- let node_tty = require("node:tty");
31
- node_tty = require_chunk.__toESM(node_tty);
26
+ let chalk = require("chalk");
27
+ chalk = require_chunk.__toESM(chalk);
32
28
  let defu = require("defu");
33
29
  defu = require_chunk.__toESM(defu);
34
30
  let _stryke_string_format_pretty_bytes = require("@stryke/string-format/pretty-bytes");
35
- let bundle_require = require("bundle-require");
36
- let node_url = require("node:url");
31
+ let _powerlines_core_lib_logger = require("@powerlines/core/lib/logger");
37
32
  let _stryke_helpers_get_field = require("@stryke/helpers/get-field");
38
33
  let _stryke_fs_json = require("@stryke/fs/json");
39
34
  require("@stryke/fs/remove-file");
@@ -48,6 +43,7 @@ let _stryke_http_fetch = require("@stryke/http/fetch");
48
43
  let _stryke_path_join = require("@stryke/path/join");
49
44
  let _stryke_type_checks_is_null = require("@stryke/type-checks/is-null");
50
45
  let _stryke_unique_id_uuid = require("@stryke/unique-id/uuid");
46
+ let bundle_require = require("bundle-require");
51
47
  let compatx = require("compatx");
52
48
  let flat_cache = require("flat-cache");
53
49
  let oxc_parser = require("oxc-parser");
@@ -62,413 +58,8 @@ let _stryke_path_is_type = require("@stryke/path/is-type");
62
58
  let _stryke_path_slash = require("@stryke/path/slash");
63
59
  let _stryke_type_checks_is_regexp = require("@stryke/type-checks/is-regexp");
64
60
  let node_buffer = require("node:buffer");
61
+ let node_url = require("node:url");
65
62
 
66
- //#region ../../node_modules/.pnpm/chalk@5.6.2/node_modules/chalk/source/vendor/ansi-styles/index.js
67
- const ANSI_BACKGROUND_OFFSET = 10;
68
- const wrapAnsi16 = (offset = 0) => (code) => `\u001B[${code + offset}m`;
69
- const wrapAnsi256 = (offset = 0) => (code) => `\u001B[${38 + offset};5;${code}m`;
70
- const wrapAnsi16m = (offset = 0) => (red, green, blue) => `\u001B[${38 + offset};2;${red};${green};${blue}m`;
71
- const styles$1 = {
72
- modifier: {
73
- reset: [0, 0],
74
- bold: [1, 22],
75
- dim: [2, 22],
76
- italic: [3, 23],
77
- underline: [4, 24],
78
- overline: [53, 55],
79
- inverse: [7, 27],
80
- hidden: [8, 28],
81
- strikethrough: [9, 29]
82
- },
83
- color: {
84
- black: [30, 39],
85
- red: [31, 39],
86
- green: [32, 39],
87
- yellow: [33, 39],
88
- blue: [34, 39],
89
- magenta: [35, 39],
90
- cyan: [36, 39],
91
- white: [37, 39],
92
- blackBright: [90, 39],
93
- gray: [90, 39],
94
- grey: [90, 39],
95
- redBright: [91, 39],
96
- greenBright: [92, 39],
97
- yellowBright: [93, 39],
98
- blueBright: [94, 39],
99
- magentaBright: [95, 39],
100
- cyanBright: [96, 39],
101
- whiteBright: [97, 39]
102
- },
103
- bgColor: {
104
- bgBlack: [40, 49],
105
- bgRed: [41, 49],
106
- bgGreen: [42, 49],
107
- bgYellow: [43, 49],
108
- bgBlue: [44, 49],
109
- bgMagenta: [45, 49],
110
- bgCyan: [46, 49],
111
- bgWhite: [47, 49],
112
- bgBlackBright: [100, 49],
113
- bgGray: [100, 49],
114
- bgGrey: [100, 49],
115
- bgRedBright: [101, 49],
116
- bgGreenBright: [102, 49],
117
- bgYellowBright: [103, 49],
118
- bgBlueBright: [104, 49],
119
- bgMagentaBright: [105, 49],
120
- bgCyanBright: [106, 49],
121
- bgWhiteBright: [107, 49]
122
- }
123
- };
124
- const modifierNames = Object.keys(styles$1.modifier);
125
- const foregroundColorNames = Object.keys(styles$1.color);
126
- const backgroundColorNames = Object.keys(styles$1.bgColor);
127
- const colorNames = [...foregroundColorNames, ...backgroundColorNames];
128
- function assembleStyles() {
129
- const codes = /* @__PURE__ */ new Map();
130
- for (const [groupName, group] of Object.entries(styles$1)) {
131
- for (const [styleName, style] of Object.entries(group)) {
132
- styles$1[styleName] = {
133
- open: `\u001B[${style[0]}m`,
134
- close: `\u001B[${style[1]}m`
135
- };
136
- group[styleName] = styles$1[styleName];
137
- codes.set(style[0], style[1]);
138
- }
139
- Object.defineProperty(styles$1, groupName, {
140
- value: group,
141
- enumerable: false
142
- });
143
- }
144
- Object.defineProperty(styles$1, "codes", {
145
- value: codes,
146
- enumerable: false
147
- });
148
- styles$1.color.close = "\x1B[39m";
149
- styles$1.bgColor.close = "\x1B[49m";
150
- styles$1.color.ansi = wrapAnsi16();
151
- styles$1.color.ansi256 = wrapAnsi256();
152
- styles$1.color.ansi16m = wrapAnsi16m();
153
- styles$1.bgColor.ansi = wrapAnsi16(ANSI_BACKGROUND_OFFSET);
154
- styles$1.bgColor.ansi256 = wrapAnsi256(ANSI_BACKGROUND_OFFSET);
155
- styles$1.bgColor.ansi16m = wrapAnsi16m(ANSI_BACKGROUND_OFFSET);
156
- Object.defineProperties(styles$1, {
157
- rgbToAnsi256: {
158
- value(red, green, blue) {
159
- if (red === green && green === blue) {
160
- if (red < 8) return 16;
161
- if (red > 248) return 231;
162
- return Math.round((red - 8) / 247 * 24) + 232;
163
- }
164
- return 16 + 36 * Math.round(red / 255 * 5) + 6 * Math.round(green / 255 * 5) + Math.round(blue / 255 * 5);
165
- },
166
- enumerable: false
167
- },
168
- hexToRgb: {
169
- value(hex) {
170
- const matches = /[a-f\d]{6}|[a-f\d]{3}/i.exec(hex.toString(16));
171
- if (!matches) return [
172
- 0,
173
- 0,
174
- 0
175
- ];
176
- let [colorString] = matches;
177
- if (colorString.length === 3) colorString = [...colorString].map((character) => character + character).join("");
178
- const integer = Number.parseInt(colorString, 16);
179
- return [
180
- integer >> 16 & 255,
181
- integer >> 8 & 255,
182
- integer & 255
183
- ];
184
- },
185
- enumerable: false
186
- },
187
- hexToAnsi256: {
188
- value: (hex) => styles$1.rgbToAnsi256(...styles$1.hexToRgb(hex)),
189
- enumerable: false
190
- },
191
- ansi256ToAnsi: {
192
- value(code) {
193
- if (code < 8) return 30 + code;
194
- if (code < 16) return 90 + (code - 8);
195
- let red;
196
- let green;
197
- let blue;
198
- if (code >= 232) {
199
- red = ((code - 232) * 10 + 8) / 255;
200
- green = red;
201
- blue = red;
202
- } else {
203
- code -= 16;
204
- const remainder = code % 36;
205
- red = Math.floor(code / 36) / 5;
206
- green = Math.floor(remainder / 6) / 5;
207
- blue = remainder % 6 / 5;
208
- }
209
- const value = Math.max(red, green, blue) * 2;
210
- if (value === 0) return 30;
211
- let result = 30 + (Math.round(blue) << 2 | Math.round(green) << 1 | Math.round(red));
212
- if (value === 2) result += 60;
213
- return result;
214
- },
215
- enumerable: false
216
- },
217
- rgbToAnsi: {
218
- value: (red, green, blue) => styles$1.ansi256ToAnsi(styles$1.rgbToAnsi256(red, green, blue)),
219
- enumerable: false
220
- },
221
- hexToAnsi: {
222
- value: (hex) => styles$1.ansi256ToAnsi(styles$1.hexToAnsi256(hex)),
223
- enumerable: false
224
- }
225
- });
226
- return styles$1;
227
- }
228
- const ansiStyles = assembleStyles();
229
-
230
- //#endregion
231
- //#region ../../node_modules/.pnpm/chalk@5.6.2/node_modules/chalk/source/vendor/supports-color/index.js
232
- function hasFlag(flag, argv = globalThis.Deno ? globalThis.Deno.args : node_process.default.argv) {
233
- const prefix = flag.startsWith("-") ? "" : flag.length === 1 ? "-" : "--";
234
- const position = argv.indexOf(prefix + flag);
235
- const terminatorPosition = argv.indexOf("--");
236
- return position !== -1 && (terminatorPosition === -1 || position < terminatorPosition);
237
- }
238
- const { env } = node_process.default;
239
- let flagForceColor;
240
- if (hasFlag("no-color") || hasFlag("no-colors") || hasFlag("color=false") || hasFlag("color=never")) flagForceColor = 0;
241
- else if (hasFlag("color") || hasFlag("colors") || hasFlag("color=true") || hasFlag("color=always")) flagForceColor = 1;
242
- function envForceColor() {
243
- if ("FORCE_COLOR" in env) {
244
- if (env.FORCE_COLOR === "true") return 1;
245
- if (env.FORCE_COLOR === "false") return 0;
246
- return env.FORCE_COLOR.length === 0 ? 1 : Math.min(Number.parseInt(env.FORCE_COLOR, 10), 3);
247
- }
248
- }
249
- function translateLevel(level) {
250
- if (level === 0) return false;
251
- return {
252
- level,
253
- hasBasic: true,
254
- has256: level >= 2,
255
- has16m: level >= 3
256
- };
257
- }
258
- function _supportsColor(haveStream, { streamIsTTY, sniffFlags = true } = {}) {
259
- const noFlagForceColor = envForceColor();
260
- if (noFlagForceColor !== void 0) flagForceColor = noFlagForceColor;
261
- const forceColor = sniffFlags ? flagForceColor : noFlagForceColor;
262
- if (forceColor === 0) return 0;
263
- if (sniffFlags) {
264
- if (hasFlag("color=16m") || hasFlag("color=full") || hasFlag("color=truecolor")) return 3;
265
- if (hasFlag("color=256")) return 2;
266
- }
267
- if ("TF_BUILD" in env && "AGENT_NAME" in env) return 1;
268
- if (haveStream && !streamIsTTY && forceColor === void 0) return 0;
269
- const min = forceColor || 0;
270
- if (env.TERM === "dumb") return min;
271
- if (node_process.default.platform === "win32") {
272
- const osRelease = node_os.default.release().split(".");
273
- if (Number(osRelease[0]) >= 10 && Number(osRelease[2]) >= 10586) return Number(osRelease[2]) >= 14931 ? 3 : 2;
274
- return 1;
275
- }
276
- if ("CI" in env) {
277
- if ([
278
- "GITHUB_ACTIONS",
279
- "GITEA_ACTIONS",
280
- "CIRCLECI"
281
- ].some((key) => key in env)) return 3;
282
- if ([
283
- "TRAVIS",
284
- "APPVEYOR",
285
- "GITLAB_CI",
286
- "BUILDKITE",
287
- "DRONE"
288
- ].some((sign) => sign in env) || env.CI_NAME === "codeship") return 1;
289
- return min;
290
- }
291
- if ("TEAMCITY_VERSION" in env) return /^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(env.TEAMCITY_VERSION) ? 1 : 0;
292
- if (env.COLORTERM === "truecolor") return 3;
293
- if (env.TERM === "xterm-kitty") return 3;
294
- if (env.TERM === "xterm-ghostty") return 3;
295
- if (env.TERM === "wezterm") return 3;
296
- if ("TERM_PROGRAM" in env) {
297
- const version = Number.parseInt((env.TERM_PROGRAM_VERSION || "").split(".")[0], 10);
298
- switch (env.TERM_PROGRAM) {
299
- case "iTerm.app": return version >= 3 ? 3 : 2;
300
- case "Apple_Terminal": return 2;
301
- }
302
- }
303
- if (/-256(color)?$/i.test(env.TERM)) return 2;
304
- if (/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(env.TERM)) return 1;
305
- if ("COLORTERM" in env) return 1;
306
- return min;
307
- }
308
- function createSupportsColor(stream, options = {}) {
309
- return translateLevel(_supportsColor(stream, {
310
- streamIsTTY: stream && stream.isTTY,
311
- ...options
312
- }));
313
- }
314
- const supportsColor = {
315
- stdout: createSupportsColor({ isTTY: node_tty.default.isatty(1) }),
316
- stderr: createSupportsColor({ isTTY: node_tty.default.isatty(2) })
317
- };
318
-
319
- //#endregion
320
- //#region ../../node_modules/.pnpm/chalk@5.6.2/node_modules/chalk/source/utilities.js
321
- function stringReplaceAll(string, substring, replacer) {
322
- let index = string.indexOf(substring);
323
- if (index === -1) return string;
324
- const substringLength = substring.length;
325
- let endIndex = 0;
326
- let returnValue = "";
327
- do {
328
- returnValue += string.slice(endIndex, index) + substring + replacer;
329
- endIndex = index + substringLength;
330
- index = string.indexOf(substring, endIndex);
331
- } while (index !== -1);
332
- returnValue += string.slice(endIndex);
333
- return returnValue;
334
- }
335
- function stringEncaseCRLFWithFirstIndex(string, prefix, postfix, index) {
336
- let endIndex = 0;
337
- let returnValue = "";
338
- do {
339
- const gotCR = string[index - 1] === "\r";
340
- returnValue += string.slice(endIndex, gotCR ? index - 1 : index) + prefix + (gotCR ? "\r\n" : "\n") + postfix;
341
- endIndex = index + 1;
342
- index = string.indexOf("\n", endIndex);
343
- } while (index !== -1);
344
- returnValue += string.slice(endIndex);
345
- return returnValue;
346
- }
347
-
348
- //#endregion
349
- //#region ../../node_modules/.pnpm/chalk@5.6.2/node_modules/chalk/source/index.js
350
- const { stdout: stdoutColor, stderr: stderrColor } = supportsColor;
351
- const GENERATOR = Symbol("GENERATOR");
352
- const STYLER = Symbol("STYLER");
353
- const IS_EMPTY = Symbol("IS_EMPTY");
354
- const levelMapping = [
355
- "ansi",
356
- "ansi",
357
- "ansi256",
358
- "ansi16m"
359
- ];
360
- const styles = Object.create(null);
361
- const applyOptions = (object, options = {}) => {
362
- if (options.level && !(Number.isInteger(options.level) && options.level >= 0 && options.level <= 3)) throw new Error("The `level` option should be an integer from 0 to 3");
363
- const colorLevel = stdoutColor ? stdoutColor.level : 0;
364
- object.level = options.level === void 0 ? colorLevel : options.level;
365
- };
366
- const chalkFactory = (options) => {
367
- const chalk = (...strings) => strings.join(" ");
368
- applyOptions(chalk, options);
369
- Object.setPrototypeOf(chalk, createChalk.prototype);
370
- return chalk;
371
- };
372
- function createChalk(options) {
373
- return chalkFactory(options);
374
- }
375
- Object.setPrototypeOf(createChalk.prototype, Function.prototype);
376
- for (const [styleName, style] of Object.entries(ansiStyles)) styles[styleName] = { get() {
377
- const builder = createBuilder(this, createStyler(style.open, style.close, this[STYLER]), this[IS_EMPTY]);
378
- Object.defineProperty(this, styleName, { value: builder });
379
- return builder;
380
- } };
381
- styles.visible = { get() {
382
- const builder = createBuilder(this, this[STYLER], true);
383
- Object.defineProperty(this, "visible", { value: builder });
384
- return builder;
385
- } };
386
- const getModelAnsi = (model, level, type, ...arguments_) => {
387
- if (model === "rgb") {
388
- if (level === "ansi16m") return ansiStyles[type].ansi16m(...arguments_);
389
- if (level === "ansi256") return ansiStyles[type].ansi256(ansiStyles.rgbToAnsi256(...arguments_));
390
- return ansiStyles[type].ansi(ansiStyles.rgbToAnsi(...arguments_));
391
- }
392
- if (model === "hex") return getModelAnsi("rgb", level, type, ...ansiStyles.hexToRgb(...arguments_));
393
- return ansiStyles[type][model](...arguments_);
394
- };
395
- for (const model of [
396
- "rgb",
397
- "hex",
398
- "ansi256"
399
- ]) {
400
- styles[model] = { get() {
401
- const { level } = this;
402
- return function(...arguments_) {
403
- const styler = createStyler(getModelAnsi(model, levelMapping[level], "color", ...arguments_), ansiStyles.color.close, this[STYLER]);
404
- return createBuilder(this, styler, this[IS_EMPTY]);
405
- };
406
- } };
407
- const bgModel = "bg" + model[0].toUpperCase() + model.slice(1);
408
- styles[bgModel] = { get() {
409
- const { level } = this;
410
- return function(...arguments_) {
411
- const styler = createStyler(getModelAnsi(model, levelMapping[level], "bgColor", ...arguments_), ansiStyles.bgColor.close, this[STYLER]);
412
- return createBuilder(this, styler, this[IS_EMPTY]);
413
- };
414
- } };
415
- }
416
- const proto = Object.defineProperties(() => {}, {
417
- ...styles,
418
- level: {
419
- enumerable: true,
420
- get() {
421
- return this[GENERATOR].level;
422
- },
423
- set(level) {
424
- this[GENERATOR].level = level;
425
- }
426
- }
427
- });
428
- const createStyler = (open, close, parent) => {
429
- let openAll;
430
- let closeAll;
431
- if (parent === void 0) {
432
- openAll = open;
433
- closeAll = close;
434
- } else {
435
- openAll = parent.openAll + open;
436
- closeAll = close + parent.closeAll;
437
- }
438
- return {
439
- open,
440
- close,
441
- openAll,
442
- closeAll,
443
- parent
444
- };
445
- };
446
- const createBuilder = (self, _styler, _isEmpty) => {
447
- const builder = (...arguments_) => applyStyle(builder, arguments_.length === 1 ? "" + arguments_[0] : arguments_.join(" "));
448
- Object.setPrototypeOf(builder, proto);
449
- builder[GENERATOR] = self;
450
- builder[STYLER] = _styler;
451
- builder[IS_EMPTY] = _isEmpty;
452
- return builder;
453
- };
454
- const applyStyle = (self, string) => {
455
- if (self.level <= 0 || !string) return self[IS_EMPTY] ? "" : string;
456
- let styler = self[STYLER];
457
- if (styler === void 0) return string;
458
- const { openAll, closeAll } = styler;
459
- if (string.includes("\x1B")) while (styler !== void 0) {
460
- string = stringReplaceAll(string, styler.close, styler.open);
461
- styler = styler.parent;
462
- }
463
- const lfIndex = string.indexOf("\n");
464
- if (lfIndex !== -1) string = stringEncaseCRLFWithFirstIndex(string, closeAll, openAll, lfIndex);
465
- return openAll + string + closeAll;
466
- };
467
- Object.defineProperties(createChalk.prototype, styles);
468
- const chalk = createChalk();
469
- const chalkStderr = createChalk({ level: stderrColor ? stderrColor.level : 0 });
470
-
471
- //#endregion
472
63
  //#region src/_internal/helpers/hooks.ts
473
64
  const mergeResultObjects = (0, defu.createDefu)((obj, key, value) => {
474
65
  if ((0, _stryke_type_checks_is_string.isString)(obj[key]) && (0, _stryke_type_checks_is_string.isString)(value)) {
@@ -514,7 +105,7 @@ function mergeConfigs(currentResult, previousResults) {
514
105
  async function callHook(context, key, options, ...args) {
515
106
  const hooks = context.selectHooks(key, options);
516
107
  if (hooks.length > 0) {
517
- context.debug(` 🧩 Calling plugin hook: ${chalk.bold.cyanBright(`${key}${options?.order ? ` (${options.order})` : ""}`)}`);
108
+ context.debug(` 🧩 Calling ${hooks.length} ${chalk.default.bold.cyanBright(`${key}${options?.order ? ` (${options.order})` : ""}`)} plugin hook${hooks.length > 1 ? "s" : ""}:\n${hooks.map((hook, index) => ` ${index + 1}. ${(0, require_utils.utils_exports.colorText)(hook.plugin.name)}`).join("\n")}`);
518
109
  const invokeHook = async (hook, hookArgs) => {
519
110
  return Reflect.apply(hook.handler, hook.context, hookArgs);
520
111
  };
@@ -561,21 +152,42 @@ function extractHooks(context, hooks, plugin, key, parentKey) {
561
152
  if (plugin.enforce) {
562
153
  const hookListOrder = `${plugin.enforce}Enforced`;
563
154
  hooks[combinedKey][hookListOrder] ??= [];
564
- const bucket = hooks[combinedKey][hookListOrder];
565
- (0, require_plugin_utils.plugin_utils_exports.addPluginHook)(context, plugin, pluginHook, bucket);
155
+ hooks[combinedKey][hookListOrder] = (0, require_plugin_utils.plugin_utils_exports.addPluginHook)(context, plugin, pluginHook, hooks[combinedKey][hookListOrder]);
566
156
  return hooks;
567
157
  }
568
158
  if ((0, _stryke_type_checks_is_function.isFunction)(pluginHook) || !pluginHook.order) {
569
159
  hooks[combinedKey].normal ??= [];
570
- const bucket = hooks[combinedKey].normal;
571
- (0, require_plugin_utils.plugin_utils_exports.addPluginHook)(context, plugin, pluginHook, bucket);
160
+ hooks[combinedKey].normal = (0, require_plugin_utils.plugin_utils_exports.addPluginHook)(context, plugin, pluginHook, hooks[combinedKey].normal);
572
161
  return hooks;
573
162
  }
574
163
  const hookListOrder = `${pluginHook.order}Ordered`;
575
164
  hooks[combinedKey][hookListOrder] ??= [];
576
- (0, require_plugin_utils.plugin_utils_exports.addPluginHook)(context, plugin, pluginHook, hooks[combinedKey][hookListOrder]);
165
+ hooks[combinedKey][hookListOrder] = (0, require_plugin_utils.plugin_utils_exports.addPluginHook)(context, plugin, pluginHook, hooks[combinedKey][hookListOrder]);
577
166
  return hooks;
578
- } else if ((0, _stryke_type_checks_is_set_object.isSetObject)(pluginField)) return Object.keys(pluginField).map((pluginKey) => extractHooks(context, hooks, plugin, pluginKey, combinedKey)).reduce((ret, current) => (0, defu.defu)(ret, current), hooks);
167
+ } else if ((0, _stryke_type_checks_is_set_object.isSetObject)(pluginField)) return Object.keys(pluginField).map((pluginKey) => extractHooks(context, hooks, plugin, pluginKey, combinedKey)).reduce((ret, current) => {
168
+ Object.keys(current).forEach((key) => {
169
+ ret[key] ??= {
170
+ preEnforced: [],
171
+ preOrdered: [],
172
+ normal: [],
173
+ postEnforced: [],
174
+ postOrdered: []
175
+ };
176
+ [
177
+ "preEnforced",
178
+ "preOrdered",
179
+ "normal",
180
+ "postEnforced",
181
+ "postOrdered"
182
+ ].forEach((order) => {
183
+ if (current[key]?.[order]) {
184
+ ret[key][order] ??= [];
185
+ ret[key][order] = ret[key][order].concat(current[key][order]);
186
+ }
187
+ });
188
+ });
189
+ return ret;
190
+ }, hooks);
579
191
  return hooks;
580
192
  }
581
193
 
@@ -2738,7 +2350,8 @@ var PowerlinesContext = class PowerlinesContext {
2738
2350
  createLog(name = null) {
2739
2351
  return (0, require_utils.utils_exports.createLog)(name, {
2740
2352
  ...this.config,
2741
- logLevel: (0, _stryke_type_checks_is_null.isNull)(this.config.logLevel) ? "silent" : this.config.logLevel
2353
+ logLevel: (0, _stryke_type_checks_is_null.isNull)(this.config.logLevel) ? "silent" : this.config.logLevel,
2354
+ command: this.config.command
2742
2355
  });
2743
2356
  }
2744
2357
  /**
@@ -2928,7 +2541,7 @@ var PowerlinesContext = class PowerlinesContext {
2928
2541
  };
2929
2542
  }), (a) => `${a.input}-${a.glob}-${a.output}`);
2930
2543
  this.config.plugins = (this.config.plugins ?? []).filter(Boolean).reduce((ret, plugin) => {
2931
- if ((0, require_plugin_utils.plugin_utils_exports.isPlugin)(plugin) && (0, require_plugin_utils.plugin_utils_exports.checkDedupe)(plugin, ret.filter((p) => (0, require_plugin_utils.plugin_utils_exports.isPlugin)(p)))) return ret;
2544
+ if ((0, require_plugin_utils.plugin_utils_exports.isPlugin)(plugin) && (0, require_plugin_utils.plugin_utils_exports.isDuplicate)(plugin, ret.filter((p) => (0, require_plugin_utils.plugin_utils_exports.isPlugin)(p)))) return ret;
2932
2545
  ret.push(plugin);
2933
2546
  return ret;
2934
2547
  }, []);
@@ -2949,7 +2562,7 @@ var PowerlinesContext = class PowerlinesContext {
2949
2562
  this.config.userConfig = (0, require_plugin_utils.plugin_utils_exports.mergeConfig)(from, into);
2950
2563
  if (this.config.userConfig.output?.format) this.config.userConfig.output.format = (0, _stryke_helpers_get_unique.getUnique)((0, _stryke_convert_to_array.toArray)(this.config.userConfig.output?.format));
2951
2564
  this.config.userConfig.plugins = (this.config.userConfig.plugins ?? []).filter(Boolean).reduce((ret, plugin) => {
2952
- if ((0, require_plugin_utils.plugin_utils_exports.isPlugin)(plugin) && (0, require_plugin_utils.plugin_utils_exports.checkDedupe)(plugin, ret.filter((p) => (0, require_plugin_utils.plugin_utils_exports.isPlugin)(p)))) return ret;
2565
+ if ((0, require_plugin_utils.plugin_utils_exports.isPlugin)(plugin) && (0, require_plugin_utils.plugin_utils_exports.isDuplicate)(plugin, ret.filter((p) => (0, require_plugin_utils.plugin_utils_exports.isPlugin)(p)))) return ret;
2953
2566
  ret.push(plugin);
2954
2567
  return ret;
2955
2568
  }, []);
@@ -3067,6 +2680,22 @@ var PowerlinesEnvironmentContext = class PowerlinesEnvironmentContext extends Po
3067
2680
  get config() {
3068
2681
  return super.config;
3069
2682
  }
2683
+ /**
2684
+ * Create a new logger instance
2685
+ *
2686
+ * @param name - The name to use for the logger instance
2687
+ * @returns A logger function
2688
+ */
2689
+ createLog(name = null) {
2690
+ return (0, _powerlines_core_lib_logger.createLog)(name, {
2691
+ ...this.config,
2692
+ logLevel: (0, _stryke_type_checks_is_null.isNull)(this.config.logLevel) ? "silent" : this.config.logLevel,
2693
+ environment: this.environment?.name
2694
+ });
2695
+ }
2696
+ /**
2697
+ * The hooks registered by plugins in this environment
2698
+ */
3070
2699
  get hooks() {
3071
2700
  return this.#hooks;
3072
2701
  }
@@ -3104,8 +2733,7 @@ var PowerlinesEnvironmentContext = class PowerlinesEnvironmentContext extends Po
3104
2733
  selectHooks(key, options) {
3105
2734
  const result = [];
3106
2735
  if ((0, require_plugin_utils.plugin_utils_exports.isPluginHookField)(key) && this.hooks[key]) {
3107
- const hooks = this.hooks[key];
3108
- if (hooks) if (options?.order) {
2736
+ if (this.hooks[key]) if (options?.order) {
3109
2737
  const mapHooksToResult = (hooksList) => hooksList.map((hook) => {
3110
2738
  const plugin = this.plugins.find((p) => p.plugin.name === hook.plugin.name);
3111
2739
  if (!plugin) throw new Error(`Could not find plugin context for plugin "${hook.plugin.name}".`);
@@ -3116,12 +2744,12 @@ var PowerlinesEnvironmentContext = class PowerlinesEnvironmentContext extends Po
3116
2744
  };
3117
2745
  });
3118
2746
  if (options?.order === "pre") {
3119
- result.push(...mapHooksToResult(hooks.preOrdered ?? []));
3120
- result.push(...mapHooksToResult(hooks.preEnforced ?? []));
2747
+ result.push(...mapHooksToResult(this.hooks[key].preOrdered ?? []));
2748
+ result.push(...mapHooksToResult(this.hooks[key].preEnforced ?? []));
3121
2749
  } else if (options?.order === "post") {
3122
- result.push(...mapHooksToResult(hooks.postOrdered ?? []));
3123
- result.push(...mapHooksToResult(hooks.postEnforced ?? []));
3124
- } else result.push(...mapHooksToResult(hooks.normal ?? []));
2750
+ result.push(...mapHooksToResult(this.hooks[key].postOrdered ?? []));
2751
+ result.push(...mapHooksToResult(this.hooks[key].postEnforced ?? []));
2752
+ } else result.push(...mapHooksToResult(this.hooks[key].normal ?? []));
3125
2753
  } else {
3126
2754
  result.push(...this.selectHooks(key, { order: "pre" }));
3127
2755
  result.push(...this.selectHooks(key, { order: "normal" }));
@@ -3287,12 +2915,12 @@ var PowerlinesAPIContext = class PowerlinesAPIContext extends PowerlinesContext
3287
2915
  if (name) environment = this.environments[name];
3288
2916
  if (Object.keys(this.environments).length === 1) {
3289
2917
  environment = this.environments[Object.keys(this.environments)[0]];
3290
- this.debug(`Applying the only configured environment: ${chalk.bold.cyanBright(environment?.environment.name)}`);
2918
+ this.debug(`Applying the only configured environment: ${chalk.default.bold.cyanBright(environment?.environment.name)}`);
3291
2919
  }
3292
2920
  if (!environment) {
3293
2921
  if (name) throw new Error(`Environment "${name}" not found.`);
3294
2922
  environment = await this.in(createDefaultEnvironment(this.config.userConfig));
3295
- this.warn(`No environment specified, and no default environment found. Using a temporary default environment: ${chalk.bold.cyanBright(environment?.environment.name)}`);
2923
+ this.warn(`No environment specified, and no default environment found. Using a temporary default environment: ${chalk.default.bold.cyanBright(environment?.environment.name)}`);
3296
2924
  }
3297
2925
  return environment;
3298
2926
  }
@@ -3388,12 +3016,6 @@ Object.defineProperty(exports, 'callHook', {
3388
3016
  return callHook;
3389
3017
  }
3390
3018
  });
3391
- Object.defineProperty(exports, 'chalk', {
3392
- enumerable: true,
3393
- get: function () {
3394
- return chalk;
3395
- }
3396
- });
3397
3019
  Object.defineProperty(exports, 'createPluginContext', {
3398
3020
  enumerable: true,
3399
3021
  get: function () {