@rzl-zone/build-tools 0.0.11 → 0.0.12

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 (80) hide show
  1. package/dist/.references/index.d.cts +1 -1
  2. package/dist/.references/index.d.ts +1 -1
  3. package/dist/bundler/rolldown.cjs +4 -4
  4. package/dist/bundler/rolldown.cjs.map +1 -1
  5. package/dist/bundler/rolldown.d.cts +2 -2
  6. package/dist/bundler/rolldown.d.ts +2 -2
  7. package/dist/bundler/rolldown.js +1 -1
  8. package/dist/bundler/rolldown.js.map +1 -1
  9. package/dist/bundler/tsdown.cjs +9 -9
  10. package/dist/bundler/tsdown.cjs.map +1 -1
  11. package/dist/bundler/tsdown.d.cts +2 -2
  12. package/dist/bundler/tsdown.d.ts +2 -2
  13. package/dist/bundler/tsdown.js +3 -3
  14. package/dist/bundler/tsdown.js.map +1 -1
  15. package/dist/bundler/utils.cjs +2 -2
  16. package/dist/bundler/utils.cjs.map +1 -1
  17. package/dist/bundler/utils.d.cts +2 -2
  18. package/dist/bundler/utils.d.ts +2 -2
  19. package/dist/bundler/utils.js +2 -2
  20. package/dist/bundler/utils.js.map +1 -1
  21. package/dist/client-B-L0njjX.js +75 -0
  22. package/dist/client-B-L0njjX.js.map +1 -0
  23. package/dist/client-BxJj_VrQ.cjs +81 -0
  24. package/dist/client-BxJj_VrQ.cjs.map +1 -0
  25. package/dist/commander-kit/index.cjs +84 -65
  26. package/dist/commander-kit/index.cjs.map +1 -1
  27. package/dist/commander-kit/index.d.cts +3 -3
  28. package/dist/commander-kit/index.d.ts +3 -3
  29. package/dist/commander-kit/index.js +24 -5
  30. package/dist/commander-kit/index.js.map +1 -1
  31. package/dist/{extra-BleSbKJp.d.ts → extra-CNDyFVA8.d.ts} +2 -2
  32. package/dist/{extra-C8r3KWjP.d.cts → extra-CtuOwfZ4.d.cts} +2 -2
  33. package/dist/{fast-globe-options-DnV58KJc.d.ts → fast-globe-options-Dj630IVV.d.ts} +3 -3
  34. package/dist/{fast-globe-options-D7S2fQZZ.d.cts → fast-globe-options-NcQT6Fg5.d.cts} +3 -3
  35. package/dist/{helper-C0AShk-j.js → formatter-Bd8fVs2h.js} +88 -3
  36. package/dist/formatter-Bd8fVs2h.js.map +1 -0
  37. package/dist/{helper-DNj9Sj4w.cjs → formatter-DEp7VUev.cjs} +142 -14
  38. package/dist/formatter-DEp7VUev.cjs.map +1 -0
  39. package/dist/{identity-CcYkvy9q.js → identity-BaFHc-2R.js} +5 -6
  40. package/dist/{identity-CcYkvy9q.js.map → identity-BaFHc-2R.js.map} +1 -1
  41. package/dist/{identity-Crq3bzhv.cjs → identity-C9ff_g77.cjs} +14 -15
  42. package/dist/{identity-Crq3bzhv.cjs.map → identity-C9ff_g77.cjs.map} +1 -1
  43. package/dist/{index-DlH2PDPD.d.cts → index-BXqEWtZV.d.cts} +2 -2
  44. package/dist/{index-BdtMQyzF.d.cts → index-DgaO182z.d.cts} +2 -2
  45. package/dist/{index-CwHGSras.d.ts → index-qpwsLgqK.d.ts} +2 -2
  46. package/dist/{index-NLQcJJFO.d.ts → index-uMbOxPvL.d.ts} +2 -2
  47. package/dist/index.cjs +221 -274
  48. package/dist/index.cjs.map +1 -1
  49. package/dist/index.d.cts +5 -5
  50. package/dist/index.d.ts +5 -5
  51. package/dist/index.js +5 -58
  52. package/dist/index.js.map +1 -1
  53. package/dist/{package-banner-DkNDAjMK.js → package-banner-Bk5L__8h.js} +4 -5
  54. package/dist/{package-banner-DkNDAjMK.js.map → package-banner-Bk5L__8h.js.map} +1 -1
  55. package/dist/package-banner-Pjznq5SP.cjs +59 -0
  56. package/dist/{package-banner-BoS7Lbi9.cjs.map → package-banner-Pjznq5SP.cjs.map} +1 -1
  57. package/dist/server-BsqxhpCl.js +198 -0
  58. package/dist/server-BsqxhpCl.js.map +1 -0
  59. package/dist/server-CyO1Pxp8.cjs +255 -0
  60. package/dist/server-CyO1Pxp8.cjs.map +1 -0
  61. package/dist/utils/client.cjs +12 -11
  62. package/dist/utils/client.d.cts +1 -1
  63. package/dist/utils/client.d.ts +1 -1
  64. package/dist/utils/client.js +3 -2
  65. package/dist/utils/server.cjs +5 -2
  66. package/dist/utils/server.d.cts +433 -3
  67. package/dist/utils/server.d.ts +433 -3
  68. package/dist/utils/server.js +3 -3
  69. package/package.json +6 -4
  70. package/dist/client-CuivP4z0.cjs +0 -221
  71. package/dist/client-CuivP4z0.cjs.map +0 -1
  72. package/dist/client-DzeqTq6Y.js +0 -160
  73. package/dist/client-DzeqTq6Y.js.map +0 -1
  74. package/dist/helper-C0AShk-j.js.map +0 -1
  75. package/dist/helper-DNj9Sj4w.cjs.map +0 -1
  76. package/dist/package-banner-BoS7Lbi9.cjs +0 -60
  77. package/dist/server-CvLC0e2m.cjs +0 -181
  78. package/dist/server-CvLC0e2m.cjs.map +0 -1
  79. package/dist/server-Dc93jndm.js +0 -142
  80. package/dist/server-Dc93jndm.js.map +0 -1
@@ -2,13 +2,14 @@
2
2
  * ========================================================================
3
3
  * @rzl-zone/build-tools
4
4
  * ------------------------------------------------------------------------
5
- * Version: `0.0.11`
5
+ * Version: `0.0.12`
6
6
  * Author: `Rizalvin Dwiky <rizalvindwiky1998@gmail.com>`
7
7
  * Repository: `https://github.com/rzl-zone/rzl-zone/tree/main/packages/build-tools`
8
8
  * ========================================================================
9
9
  */
10
10
 
11
- import { n as PatternOptions, r as defaultPatternOptions, t as PatternConfig } from "../fast-globe-options-DnV58KJc.js";
11
+ import { t as AnyString } from "../extra-CNDyFVA8.js";
12
+ import { n as PatternOptions, r as defaultPatternOptions, t as PatternConfig } from "../fast-globe-options-Dj630IVV.js";
12
13
  import _fastGlob from "fast-glob";
13
14
  import _fsExtra from "fs-extra";
14
15
  type Icons = { readonly [K in keyof typeof emojiIcons]: string };
@@ -81,6 +82,435 @@ declare const emojiIcons: {
81
82
  *
82
83
  */
83
84
  declare const ICONS: Readonly<Icons>;
85
+ /** -------------------------------------------------------------------
86
+ * * ***Determines whether an option value comes from the default configuration
87
+ * or has been explicitly overridden by the user.***
88
+ * -------------------------------------------------------------------
89
+ *
90
+ * This utility is primarily intended for logging and debugging purposes,
91
+ * especially in CLI tools or build pipelines where distinguishing between
92
+ * default and user-provided values is important.
93
+ *
94
+ * The comparison is performed using `Object.is` to ensure accurate detection,
95
+ * including edge cases such as:
96
+ * - `NaN` vs `NaN`.
97
+ * - `-0` vs `+0`.
98
+ *
99
+ * @template T - The type of the option value being compared.
100
+ *
101
+ * @param {unknown} value - The actual value used at runtime.
102
+ * @param {unknown} defaultValue - The default value defined by the tool.
103
+ *
104
+ * @returns
105
+ * A string indicating the source of the value:
106
+ *
107
+ * - `"default"` when `value` is strictly equal to `defaultValue`.
108
+ * - `"overridden"` when the value differs from the default.
109
+ *
110
+ * @example
111
+ * ```ts
112
+ * sourceOf("dist", "dist"); // ➔ "default"
113
+ * sourceOf("dist/types", "dist"); // ➔ "overridden"
114
+ * ```
115
+ *
116
+ * @example
117
+ * ***CLI-style option logging:***
118
+ * ```ts
119
+ * BUILD_LOGGER.OPTIONS(
120
+ * "outDir",
121
+ * outDir,
122
+ * sourceOf(outDir, DEFAULTS.outDir)
123
+ * );
124
+ * ```
125
+ */
126
+ declare const sourceOf: <T>(value: T, defaultValue: T) => "default" | "overridden";
127
+ /** ----------------------------------------------------------------
128
+ * * ***Deep default source detector.***
129
+ * ----------------------------------------------------------------
130
+ *
131
+ * Determines whether a given value is structurally identical
132
+ * to its default value using deep comparison.
133
+ *
134
+ * Unlike `Object.is`, this utility compares object contents
135
+ * recursively rather than checking reference identity.
136
+ *
137
+ * Intended for configuration systems where option objects
138
+ * may be cloned or reconstructed but still represent the
139
+ * default state.
140
+ *
141
+ * @template T - Value type being compared.
142
+ *
143
+ * @param value - Current runtime value.
144
+ * @param defaultValue - Default reference value.
145
+ *
146
+ * @returns
147
+ * - `"default"` ➔ If values are deeply equal.
148
+ * - `"overridden"` ➔ If values differ.
149
+ *
150
+ * @example
151
+ * ```ts
152
+ * sourceOfIsDeepStrictEqual(
153
+ * { onlyFiles: true },
154
+ * { onlyFiles: true }
155
+ * );
156
+ * // "default"
157
+ * ```
158
+ */
159
+ declare const sourceOfIsDeepStrictEqual: <T>(value: T, defaultValue: T) => "default" | "overridden";
160
+ /** -------------------------------------------------------------------
161
+ * * ***Structured build-time console logger with consistent formatting,
162
+ * icons, and colorized output.***
163
+ * --------------------------------------------------------------------
164
+ *
165
+ * `BUILD_LOGGER` provides a collection of standardized logging helpers
166
+ * intended for **CLI tools, build scripts, and Node.js-based workflows**.
167
+ *
168
+ * - **It ensures:**
169
+ * - Consistent log structure across different build phases.
170
+ * - Clear visual distinction between states (start, success, skip, error).
171
+ * - Emoji or ASCII icon support depending on environment configuration.
172
+ * - Readable, colorized output via `picocolors`.
173
+ *
174
+ * Emoji usage is controlled via the environment variable:
175
+ *
176
+ * ```
177
+ * FORCE_EMOJI=1
178
+ * ```
179
+ *
180
+ * When disabled, all icons gracefully fall back to ASCII-safe symbols.
181
+ *
182
+ * ---
183
+ *
184
+ * - **Behavior:**
185
+ * - Uses emoji icons when `FORCE_EMOJI === "1"`.
186
+ * - Falls back to ASCII symbols otherwise.
187
+ * - Applies consistent spacing, bulleting, and indentation.
188
+ * - Formats messages using `picocolors` for visibility.
189
+ * - Safely extracts error messages from unknown error values.
190
+ *
191
+ * ---
192
+ *
193
+ * - **Available log actions:**
194
+ * - `SOURCE_OF`:
195
+ * - See {@link sourceOf | **`sourceOf`**} helpers.
196
+ *
197
+ * - `OPTIONS({ label, value, source, isRequired })`:
198
+ * - Logs the options argument function using
199
+ * {@link sourceOf | **`sourceOf`**} helper.
200
+ *
201
+ * - `NEW_LINE()`:
202
+ * - *Inserts an empty line in the console output.*
203
+ *
204
+ * - `ON_STARTING({ actionName })`:
205
+ * - *Logs the start of a build or processing action.*
206
+ *
207
+ * - `ON_FINISH({ actionName, count })`:
208
+ * - *Logs successful completion with item count.*
209
+ *
210
+ * - `ON_SKIPPING({ actionName, reasonEndText })`:
211
+ * - *Logs skipped actions with human-readable reasons.*
212
+ *
213
+ * - `ON_ERROR({ actionName, error })`:
214
+ * - *Logs formatted error output with extracted message.*
215
+ *
216
+ * - `ON_PROCESS_COPY({ actionName, copyFrom, copyTo })`:
217
+ * - *Logs file copy operations.*
218
+ *
219
+ * - `ON_PROCESS({ actionName, nameDirect })`:
220
+ * - *Logs generic processing steps.*
221
+ *
222
+ * - `ON_PROCESS_REFERENCING({ actionName, referenceFrom, referenceTo })`:
223
+ * - *Logs reference or linking operations.*
224
+ *
225
+ * ---
226
+ *
227
+ * This logger is intentionally **side-effectful** and writes directly
228
+ * to `console.log` / `console.error`.
229
+ *
230
+ * It is designed for **human-readable output**, not structured logging
231
+ * or machine parsing.
232
+ */
233
+ declare const BUILD_LOGGER: LoggerBuilder;
234
+ type LoggerBuilder = {
235
+ SOURCE_OF: typeof sourceOf;
236
+ OPTIONS(label: string, value: unknown, source: ReturnType<typeof sourceOf> | AnyString, isRequired?: boolean): void;
237
+ SECTION(title: string, options?: LoggerBuilderSection): void;
238
+ NEW_LINE(value?: string): void;
239
+ ON_STARTING: (options: LoggerBuilderOnStarting) => void;
240
+ ON_FINISH: (options: LoggerBuilderOnFinish) => void;
241
+ ON_SKIPPING: (options: LoggerBuilderOnSkipping) => void;
242
+ ON_ERROR: (options: LoggerBuilderOnError) => void;
243
+ ON_PROCESS: (options: LoggerBuilderOnProcess) => void;
244
+ ON_PROCESS_COPY: (options: LoggerBuilderOnProcessCopy) => void;
245
+ ON_PROCESS_COPY_ERROR: (options: LoggerBuilderOnProcessCopyError) => void;
246
+ ON_PROCESS_REFERENCING: (options: LoggerBuilderOnProcessReferencing) => void;
247
+ };
248
+ type LoggerBuilderSection = {
249
+ /**
250
+ * @default ICON.config
251
+ */
252
+ icon?: string;
253
+ /**
254
+ * @default ""
255
+ */
256
+ indent?: string;
257
+ };
258
+ type LoggerBuilderOnStarting = {
259
+ /** The name of the action being started.
260
+ *
261
+ * @default
262
+ * undefined
263
+ */
264
+ actionName: string;
265
+ /** Connector word used before the action name.
266
+ *
267
+ * @default
268
+ * "to"
269
+ */
270
+ textDirectAction?: string;
271
+ };
272
+ type LoggerBuilderOnFinish = {
273
+ /** The name of the completed action.
274
+ *
275
+ * @default
276
+ * undefined
277
+ */
278
+ actionName: string;
279
+ /** The success text.
280
+ *
281
+ * @default
282
+ * @default "Success"
283
+ */
284
+ textSuccess?: string;
285
+ /** Label for the count unit.
286
+ *
287
+ * @default
288
+ * "file"
289
+ */
290
+ typeCount?: string;
291
+ /** Number of processed items.
292
+ *
293
+ * @default
294
+ * undefined
295
+ */
296
+ count: number;
297
+ /** Progress of processed items (e.g. `2/7`).
298
+ *
299
+ * Represents how many items have been processed relative to the total.
300
+ *
301
+ * @example
302
+ * "2/7"
303
+ */
304
+ progress?: string;
305
+ };
306
+ type LoggerBuilderOnSkipping = {
307
+ /** The name of the skipped action.
308
+ *
309
+ * @default
310
+ * undefined
311
+ */
312
+ actionName: string;
313
+ /** Connector word explaining the reason.
314
+ *
315
+ * @default
316
+ * "because"
317
+ */
318
+ reasonTitle?: string;
319
+ /** Short reason phrase.
320
+ *
321
+ * @default
322
+ * "nothing left"
323
+ */
324
+ reasonSkipAction?: string;
325
+ /** Contextual explanation for the skip.
326
+ *
327
+ * @default
328
+ * undefined
329
+ */
330
+ reasonEndText: string;
331
+ /** Type of resource involved.
332
+ *
333
+ * @default
334
+ * "files"
335
+ */
336
+ reasonType?: string;
337
+ /** Connector word before the target.
338
+ *
339
+ * @default
340
+ * "to"
341
+ */
342
+ textDirectAction?: string;
343
+ };
344
+ type LoggerBuilderOnError = {
345
+ /** The name of the action that failed.
346
+ *
347
+ * @default
348
+ * undefined
349
+ */
350
+ actionName: string;
351
+ /** Connector word before the action name.
352
+ *
353
+ * @default
354
+ * "to"
355
+ */
356
+ textDirectAction?: string;
357
+ /** Unknown error object or `Error` instance.
358
+ *
359
+ */
360
+ error: unknown;
361
+ };
362
+ type LoggerBuilderOnProcess = {
363
+ /** Description of the process.
364
+ *
365
+ * @default
366
+ * undefined
367
+ */
368
+ actionName: string;
369
+ /** Sequence number.
370
+ *
371
+ * @default
372
+ * undefined
373
+ */
374
+ count: number;
375
+ /** Connector word before the target.
376
+ *
377
+ * @default
378
+ * "in"
379
+ */
380
+ textDirectFolder?: string;
381
+ /** Target name or location.
382
+ *
383
+ * @default
384
+ * undefined
385
+ */
386
+ nameDirect: string;
387
+ };
388
+ type LoggerBuilderOnProcessCopy = {
389
+ /** The name of the action being the copy action.
390
+ *
391
+ * @default
392
+ * undefined
393
+ */
394
+ actionName: string;
395
+ /** Sequence number of the process.
396
+ *
397
+ * @default
398
+ * undefined
399
+ */
400
+ count: number;
401
+ /** Connector text before source path.
402
+ *
403
+ * @default
404
+ * "from"
405
+ */
406
+ textFrom?: string;
407
+ /** Source path.
408
+ *
409
+ * @default
410
+ * undefined
411
+ */
412
+ copyFrom: string;
413
+ /** Destination path.
414
+ *
415
+ * @default
416
+ * undefined
417
+ */
418
+ copyTo: string;
419
+ /** Arrow symbol between paths.
420
+ *
421
+ * @default
422
+ * "➔"
423
+ */
424
+ textArrow?: string;
425
+ };
426
+ type LoggerBuilderOnProcessCopyError = {
427
+ /** The name of the action being the error copy action.
428
+ *
429
+ * @default
430
+ * undefined
431
+ */
432
+ actionName: string;
433
+ /** Sequence number of the process.
434
+ *
435
+ * @default
436
+ * undefined
437
+ */
438
+ count: number;
439
+ /** Index number parameter.
440
+ *
441
+ * @default
442
+ * undefined
443
+ */
444
+ index?: number;
445
+ /** Index key name for parameter.
446
+ *
447
+ * @default
448
+ * undefined
449
+ */
450
+ indexKey?: string;
451
+ /** Connector text before source path.
452
+ *
453
+ * @default
454
+ * "from"
455
+ */
456
+ textFrom?: string;
457
+ /** Source path.
458
+ *
459
+ * @default
460
+ * undefined
461
+ */
462
+ copyFrom: string;
463
+ /** The reason error on copying.
464
+ *
465
+ * @default
466
+ * undefined
467
+ */
468
+ errorReason: string | Error;
469
+ /** Connector word explaining the reason.
470
+ *
471
+ * @default
472
+ * "because"
473
+ */
474
+ textReason?: string;
475
+ };
476
+ type LoggerBuilderOnProcessReferencing = {
477
+ /** The name of the action being the referencing action.
478
+ *
479
+ * @default
480
+ * undefined
481
+ */
482
+ actionName: string;
483
+ /** Sequence number.
484
+ *
485
+ * @default
486
+ * undefined
487
+ */
488
+ count: number;
489
+ /** Connector text before source.
490
+ *
491
+ * @default
492
+ * "from"
493
+ */
494
+ textFrom?: string;
495
+ /** Source reference path.
496
+ *
497
+ * @default
498
+ * undefined
499
+ */
500
+ referenceFrom: string;
501
+ /** Target reference path.
502
+ *
503
+ * @default
504
+ * undefined
505
+ */
506
+ referenceTo: string;
507
+ /** Arrow symbol between references.
508
+ *
509
+ * @default
510
+ * "➔"
511
+ */
512
+ textArrow?: string;
513
+ };
84
514
  /** ----------------------------------------------------------------
85
515
  * * ***Node.js–only filesystem utilities (fs-extra).***
86
516
  * ----------------------------------------------------------------
@@ -120,5 +550,5 @@ declare const fsExtra: typeof _fsExtra;
120
550
  * @environment node
121
551
  */
122
552
  declare const fastGlob: typeof _fastGlob;
123
- export { ICONS, type PatternConfig, type PatternOptions, defaultPatternOptions, fastGlob, fsExtra };
553
+ export { BUILD_LOGGER, ICONS, type PatternConfig, type PatternOptions, defaultPatternOptions, fastGlob, fsExtra, sourceOf, sourceOfIsDeepStrictEqual };
124
554
  //# sourceMappingURL=server.d.ts.map
@@ -2,11 +2,11 @@
2
2
  * ========================================================================
3
3
  * @rzl-zone/build-tools
4
4
  * ------------------------------------------------------------------------
5
- * Version: `0.0.11`
5
+ * Version: `0.0.12`
6
6
  * Author: `Rizalvin Dwiky <rizalvindwiky1998@gmail.com>`
7
7
  * Repository: `https://github.com/rzl-zone/rzl-zone/tree/main/packages/build-tools`
8
8
  * ========================================================================
9
9
  */
10
10
 
11
- import { i as defaultPatternOptions, n as fsExtra, r as ICONS, t as fastGlob } from "../server-Dc93jndm.js";
12
- export { ICONS, defaultPatternOptions, fastGlob, fsExtra };
11
+ import { a as sourceOfIsDeepStrictEqual, i as sourceOf, n as fsExtra, o as ICONS, r as BUILD_LOGGER, s as defaultPatternOptions, t as fastGlob } from "../server-BsqxhpCl.js";
12
+ export { BUILD_LOGGER, ICONS, defaultPatternOptions, fastGlob, fsExtra, sourceOf, sourceOfIsDeepStrictEqual };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rzl-zone/build-tools",
3
- "version": "0.0.11",
3
+ "version": "0.0.12",
4
4
  "description": "Toolkit to standardize and improve TypeScript and JavaScript build outputs.",
5
5
  "license": "MIT",
6
6
  "author": "Rizalvin Dwiky <rizalvindwiky1998@gmail.com>",
@@ -44,6 +44,7 @@
44
44
  "dist",
45
45
  "README.md",
46
46
  "LICENSE.md",
47
+ "LICENSE",
47
48
  "!**/*.test.*"
48
49
  ],
49
50
  "exports": {
@@ -118,7 +119,7 @@
118
119
  "picocolors": "^1.1.1",
119
120
  "semver": "^7.7.4",
120
121
  "shell-quote": "^1.8.3",
121
- "@rzl-zone/node-only": "0.0.9"
122
+ "@rzl-zone/node-only": "0.0.10"
122
123
  },
123
124
  "devDependencies": {
124
125
  "@types/babel__traverse": "^7.28.0",
@@ -127,9 +128,10 @@
127
128
  "eslint": "^9.39.2",
128
129
  "rolldown": "^1.0.0-rc.15",
129
130
  "terser": "^5.46.1",
130
- "tsdown": "0.21.8",
131
+ "tsdown": "0.22.0",
131
132
  "type-fest": "5.5.0",
132
- "typescript": "^6.0.2",
133
+ "typescript": "6.0.3",
134
+ "unrun": "^0.3.0",
133
135
  "@workspace/eslint-config": "0.0.0",
134
136
  "@workspace/typescript-config": "0.0.0"
135
137
  },