@rzl-zone/build-tools 0.0.9 → 0.0.10

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 (65) 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 +2 -2
  4. package/dist/bundler/rolldown.d.cts +2 -2
  5. package/dist/bundler/rolldown.d.ts +2 -2
  6. package/dist/bundler/rolldown.js +1 -1
  7. package/dist/bundler/tsdown.cjs +3 -3
  8. package/dist/bundler/tsdown.d.cts +2 -2
  9. package/dist/bundler/tsdown.d.ts +2 -2
  10. package/dist/bundler/tsdown.js +3 -3
  11. package/dist/bundler/utils.cjs +2 -2
  12. package/dist/bundler/utils.d.cts +2 -2
  13. package/dist/bundler/utils.d.ts +2 -2
  14. package/dist/bundler/utils.js +2 -2
  15. package/dist/{client-DUlrjus0.js → client-BmfdVI22.js} +3 -3
  16. package/dist/client-BmfdVI22.js.map +1 -0
  17. package/dist/{client-C3jHSAqV.cjs → client-DnTjQyyo.cjs} +3 -3
  18. package/dist/client-DnTjQyyo.cjs.map +1 -0
  19. package/dist/commander-kit/index.cjs +5 -5
  20. package/dist/commander-kit/index.cjs.map +1 -1
  21. package/dist/commander-kit/index.d.cts +3 -3
  22. package/dist/commander-kit/index.d.ts +3 -3
  23. package/dist/commander-kit/index.js +5 -5
  24. package/dist/commander-kit/index.js.map +1 -1
  25. package/dist/{extra-CsRmdXC4.d.cts → extra-CYpD3D9p.d.ts} +2 -2
  26. package/dist/{extra-DxvrBev9.d.ts → extra-Dc_eIyiW.d.cts} +2 -2
  27. package/dist/{fast-globe-options-PH-bHWVK.d.cts → fast-globe-options-BtIrCNb6.d.cts} +3 -3
  28. package/dist/{fast-globe-options-Cz8KJqKc.d.ts → fast-globe-options-CZ-9wIKV.d.ts} +3 -3
  29. package/dist/{helper-D11A-ZKL.js → helper-CWU8QYq3.js} +2 -2
  30. package/dist/{helper-D11A-ZKL.js.map → helper-CWU8QYq3.js.map} +1 -1
  31. package/dist/{helper-DpeqwciR.cjs → helper-DvCvgDxy.cjs} +2 -2
  32. package/dist/{helper-DpeqwciR.cjs.map → helper-DvCvgDxy.cjs.map} +1 -1
  33. package/dist/{identity-ByjqnR8L.cjs → identity-D192lL-_.cjs} +6 -6
  34. package/dist/{identity-ByjqnR8L.cjs.map → identity-D192lL-_.cjs.map} +1 -1
  35. package/dist/{identity-C5MeSAA7.js → identity-xuDCNgfm.js} +6 -6
  36. package/dist/{identity-C5MeSAA7.js.map → identity-xuDCNgfm.js.map} +1 -1
  37. package/dist/{index-TgjbNRWB.d.cts → index-1FKLQ7ah.d.cts} +2 -2
  38. package/dist/{index-B1t7Xs3T.d.ts → index-CEsO_rxz.d.ts} +2 -2
  39. package/dist/{index-xAz8brx-.d.cts → index-DW1JFluR.d.cts} +2 -2
  40. package/dist/{index-Dvmmz0f_.d.ts → index-qft-a5kh.d.ts} +2 -2
  41. package/dist/index.cjs +6 -6
  42. package/dist/index.cjs.map +1 -1
  43. package/dist/index.d.cts +5 -5
  44. package/dist/index.d.ts +5 -5
  45. package/dist/index.js +6 -6
  46. package/dist/index.js.map +1 -1
  47. package/dist/{package-banner-ByfR7yCv.cjs → package-banner-BHyF8RdG.cjs} +5 -5
  48. package/dist/{package-banner-ByfR7yCv.cjs.map → package-banner-BHyF8RdG.cjs.map} +1 -1
  49. package/dist/{package-banner-vwqcAX8E.js → package-banner-BmLNyezO.js} +5 -5
  50. package/dist/{package-banner-vwqcAX8E.js.map → package-banner-BmLNyezO.js.map} +1 -1
  51. package/dist/{server-1H2HFAbi.js → server-BA7ruG1h.js} +3 -3
  52. package/dist/{server-1H2HFAbi.js.map → server-BA7ruG1h.js.map} +1 -1
  53. package/dist/{server-BK6eykjo.cjs → server-DZvrqlyy.cjs} +3 -3
  54. package/dist/{server-BK6eykjo.cjs.map → server-DZvrqlyy.cjs.map} +1 -1
  55. package/dist/utils/client.cjs +2 -2
  56. package/dist/utils/client.d.cts +25 -7
  57. package/dist/utils/client.d.ts +25 -7
  58. package/dist/utils/client.js +2 -2
  59. package/dist/utils/server.cjs +2 -2
  60. package/dist/utils/server.d.cts +2 -2
  61. package/dist/utils/server.d.ts +2 -2
  62. package/dist/utils/server.js +2 -2
  63. package/package.json +2 -2
  64. package/dist/client-C3jHSAqV.cjs.map +0 -1
  65. package/dist/client-DUlrjus0.js.map +0 -1
@@ -2,16 +2,16 @@
2
2
  * ========================================================================
3
3
  * @rzl-zone/build-tools
4
4
  * ------------------------------------------------------------------------
5
- * Version: `0.0.9`
5
+ * Version: `0.0.10`
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
11
  "use strict";
12
- const require_helper = require('./helper-DpeqwciR.cjs');
13
- const require_server = require('./server-BK6eykjo.cjs');
14
- const require_client = require('./client-C3jHSAqV.cjs');
12
+ const require_helper = require('./helper-DvCvgDxy.cjs');
13
+ const require_server = require('./server-DZvrqlyy.cjs');
14
+ const require_client = require('./client-DnTjQyyo.cjs');
15
15
  require("@rzl-zone/node-only");
16
16
  let node_path = require("node:path");
17
17
  node_path = require_helper.__toESM(node_path, 1);
@@ -57,4 +57,4 @@ Object.defineProperty(exports, 'getPackageJson', {
57
57
  return getPackageJson;
58
58
  }
59
59
  });
60
- //# sourceMappingURL=package-banner-ByfR7yCv.cjs.map
60
+ //# sourceMappingURL=package-banner-BHyF8RdG.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"package-banner-ByfR7yCv.cjs","names":["isNonEmptyString","path","fsExtra","EOL","isPlainObject","EOL","isNonEmptyString","joinLinesLoose"],"sources":["../src/core/get/package-json/index.ts","../src/core/generate/package-banner/index.ts"],"sourcesContent":["import \"@rzl-zone/node-only\";\n\nimport type { PackageJson } from \"type-fest\";\n\nimport path from \"node:path\";\n\nimport { isNonEmptyString } from \"@/_internal/utils/helper\";\n\nimport { fsExtra } from \"@/utils/server\";\nimport { EOL } from \"@/utils/client\";\n\n//? Types ----------------------------------------------------------------\n/** ----------------------------------------------------------------\n * * ***Configuration options for {@link getPackageJson | **`get-package-json`**}.***\n * ----------------------------------------------------------------\n */\nexport type GetPackageJsonOptions = {\n /** ----------------------------------------------------------------\n * * ***Working directory of the target project.***\n * ----------------------------------------------------------------\n *\n * This determines where the lookup for `package.json`\n * will start.\n *\n * - If provided, resolution begins from this directory.\n * - If omitted, defaults to `process.cwd()`.\n *\n * - ***Typical use cases:***\n * - CLI tools executed in a project directory.\n * - Monorepo root resolution.\n * - Custom build pipelines.\n *\n * @default process.cwd()\n *\n * @remarks\n * This should be the directory containing your project's\n * `package.json`, not the directory of this package.\n */\n cwd?: string;\n};\n\n//? Main -----------------------------------------------------------------\n/** ----------------------------------------------------------------\n * * ***Resolve and read the nearest `package.json`.***\n * ----------------------------------------------------------------\n *\n * This utility locates and loads the closest `package.json`\n * by walking up the directory tree starting from a given\n * working directory.\n *\n * - *Key characteristics:*\n * - Works in **Node ESM and CJS**.\n * - Compatible with **tsdown, rolldown, tsup, esbuild, vite, tsx, ts-node, and others**.\n * - Does **not** rely on JSON module imports.\n * - Fully typed via {@link PackageJson | **PackageJson**}.\n *\n * - *This function is intended for:*\n * - Build tools.\n * - Bundler configuration.\n * - CLI utilities.\n * - Monorepo-aware infrastructure code.\n *\n * @param options Optional resolution configuration.\n *\n * @returns The parsed contents of the resolved `package.json`.\n *\n * @example\n * ```ts\n * const pkg = await getPackageJson();\n * console.log(pkg.name, pkg.version);\n * ```\n *\n * @example\n * ```ts\n * const pkg = await getPackageJson({\n * cwd: process.cwd()\n * });\n * ```\n *\n * @throws If no `package.json` can be found.\n * @throws If the located `package.json` is invalid JSON.\n *\n * @remarks\n * - Resolution always starts from `cwd` or `process.cwd()`.\n * - Results are not cached by default.\n * - Designed for infrastructure-level usage, not hot paths.\n */\nexport const getPackageJson = async (\n options: GetPackageJsonOptions = {}\n): Promise<PackageJson> => {\n const startDir = isNonEmptyString(options.cwd)\n ? path.resolve(options.cwd)\n : process.cwd();\n\n let current = startDir;\n\n while (true) {\n const pkgPath = path.join(current, \"package.json\");\n\n if (fsExtra.existsSync(pkgPath)) {\n try {\n return JSON.parse(fsExtra.readFileSync(pkgPath, \"utf-8\"));\n } catch (err) {\n throw new Error(\n `[@rzl-zone/build-tools] - (get-package-json): Invalid package.json at '${pkgPath}'` +\n EOL +\n `Reason: ${(err as Error)?.message || \"unknown\"}`,\n { cause: err }\n );\n }\n }\n\n const parent = path.dirname(current);\n if (parent === current) break;\n\n current = parent;\n }\n\n throw new Error(\n \"[@rzl-zone/build-tools] - (get-package-json): Unable to locate package.json\"\n );\n};\n\n/** @deprecated Use {@link getPackageJson | `getPackageJson`} instead. */\nconst _getPackageJson = async (\n options: GetPackageJsonOptions = {}\n): Promise<PackageJson> => {\n return await getPackageJson(options);\n // if (options.cwd && options.from) {\n // throw new Error(\"Provide either `cwd` or `from`, not both.\");\n // }\n\n // const cwd = isNonEmptyString(options.cwd) ? options.cwd : process.cwd();\n\n // const baseUrl =\n // options.from && isNil(options.cwd)\n // ? options.from\n // : pathToFileURL(path.resolve(cwd, \"__entry__.js\"));\n\n // const createRequire = await getCreateRequire();\n // const reqPkg = createRequire(baseUrl);\n\n // let current = cwd;\n\n // while (true) {\n // const pkgPath = path.join(current, \"package.json\");\n\n // if (fsExtra.existsSync(pkgPath)) return reqPkg(pkgPath);\n\n // const parent = path.dirname(current);\n // if (parent === current) break;\n // current = parent;\n // }\n\n // throw new Error(\n // \"[@rzl-zone/build-tools] - (get-package-json): Unable to locate package.json !!!\"\n // );\n};\n","import \"@rzl-zone/node-only\";\n\nimport type { PackageJson } from \"type-fest\";\n\nimport { isNonEmptyString, isPlainObject } from \"@/_internal/utils/helper\";\n\nimport { EOL, joinLinesLoose } from \"@/utils/helper/formatter\";\nimport { getPackageJson } from \"../../get/package-json\";\n\n//? Types ----------------------------------------------------------------\n/** ----------------------------------------------------------------\n * * ***Configuration options for {@link generatePackageBanner | **`generate-package-banner`**}.***\n * ----------------------------------------------------------------\n */\nexport type GeneratePackageBannerOptions = {\n /** ----------------------------------------------------------------\n * * ***Display title shown in the banner.***\n * ----------------------------------------------------------------\n *\n * Defaults to the `name` field from `package.json`\n * when available.\n */\n title?: string;\n\n /** ----------------------------------------------------------------\n * * ***Author name displayed in the banner.***\n * ----------------------------------------------------------------\n *\n * When omitted, attempts to resolve from:\n * - `author.name`.\n * - `author` (*string*).\n */\n author?: string;\n\n /** ----------------------------------------------------------------\n * * ***Custom package metadata override.***\n * ----------------------------------------------------------------\n *\n * When provided, this object will be used instead of\n * reading from the filesystem.\n *\n * - Useful for testing or advanced build pipelines.\n */\n packageJson?: PackageJson;\n\n /** ----------------------------------------------------------------\n * * ***Append an end-of-file newline to the banner output.***\n * ----------------------------------------------------------------\n *\n * Controls whether the generated banner is terminated with\n * an end-of-file (EOF) newline character.\n *\n * When enabled, a trailing newline is appended to ensure:\n * - POSIX-compliant text files.\n * - Clean concatenation with subsequent source content.\n * - Consistent formatting during code injection.\n *\n * @default true\n */\n withEof?: boolean;\n};\n\n//? Main -----------------------------------------------------------------\n/** ----------------------------------------------------------------\n * * ***Generate a standardized top banner from `package.json`.***\n * ----------------------------------------------------------------\n *\n * This utility generates a formatted banner comment suitable\n * for insertion at the top of bundled output files.\n *\n * By default, it automatically locates and reads the nearest\n * `package.json` file, you may also provide a custom package object\n * through the options parameter.\n *\n * - *Banner features:*\n * - Reads metadata from the nearest `package.json`.\n * - Supports custom package metadata via options.\n * - Provides safe fallbacks for missing fields.\n * - Produces a consistent, readable comment block.\n * - Normalizes repository URLs when possible.\n *\n * - *This function is intended for:*\n * - Bundler banners (tsdown, tsup, rollup, esbuild, etc).\n * - Generated build artifacts.\n * - Distributed library outputs.\n *\n * @param {GeneratePackageBannerOptions} [options]\n * Optional banner configuration.\n *\n * @returns {Promise<string>}\n * A formatted banner comment string.\n *\n * @throws {Error}\n * If no `package.json` can be found.\n *\n * @throws {Error}\n * If the resolved `package.json` contains invalid JSON.\n *\n * @example\n * ```ts\n * const banner = await generatePackageBanner({\n * title: \"Rzl Build Tools\",\n * author: \"Rzl\"\n * });\n * ```\n *\n * @example\n * ```ts\n * const banner = await generatePackageBanner();\n * ```\n */\nexport const generatePackageBanner = async (\n options: GeneratePackageBannerOptions = {}\n): Promise<string> => {\n let pkgJson: PackageJson | undefined;\n\n if (isPlainObject(options.packageJson)) {\n pkgJson = options.packageJson;\n } else {\n try {\n pkgJson = await getPackageJson();\n } catch (error) {\n throw new Error(\n \"[@rzl-zone/build-tools] - (generate-package-banner): Failed to resolve package.json\" +\n EOL +\n `Reason: ${(error as Error)?.message || \"unknown\"}`,\n { cause: error }\n );\n }\n }\n\n const withEof = options.withEof ?? true;\n\n const title =\n options.title ??\n (isNonEmptyString(pkgJson.name) ? pkgJson.name : \"Unknown Package\");\n\n const version = isNonEmptyString(pkgJson.version)\n ? pkgJson.version\n : \"Unknown\";\n\n const author =\n options.author ??\n (isNonEmptyString(pkgJson.author)\n ? pkgJson.author\n : isPlainObject(pkgJson.author) && isNonEmptyString(pkgJson.author.name)\n ? pkgJson.author.name\n : \"Unknown\");\n\n const repository = isNonEmptyString(pkgJson.homepage)\n ? pkgJson.homepage.split(\"#\")[0]\n : isNonEmptyString(pkgJson.repository)\n ? pkgJson.repository.replace(/^git\\+/, \"\").replace(/\\.git$/, \"\")\n : isPlainObject(pkgJson.repository) &&\n isNonEmptyString(pkgJson.repository.url)\n ? pkgJson.repository.url.replace(/^git\\+/, \"\").replace(/\\.git$/, \"\")\n : \"Unknown\";\n\n return joinLinesLoose(\n \"/*!\",\n \"* ========================================================================\",\n `* ${title}`,\n \"* ------------------------------------------------------------------------\",\n `* Version: \\`${version}\\``,\n `* Author: \\`${author}\\``,\n `* Repository: \\`${repository}\\``,\n \"* ========================================================================\",\n \"*/\",\n withEof ? \"\" : false\n );\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAuFA,MAAa,iBAAiB,OAC5B,UAAiC,EAAE,KACV;CAKzB,IAAI,UAJaA,gCAAiB,QAAQ,IAAI,GAC1CC,kBAAK,QAAQ,QAAQ,IAAI,GACzB,QAAQ,KAAK;AAIjB,QAAO,MAAM;EACX,MAAM,UAAUA,kBAAK,KAAK,SAAS,eAAe;AAElD,MAAIC,uBAAQ,WAAW,QAAQ,CAC7B,KAAI;AACF,UAAO,KAAK,MAAMA,uBAAQ,aAAa,SAAS,QAAQ,CAAC;WAClD,KAAK;AACZ,SAAM,IAAI,MACR,0EAA0E,QAAQ,KAChFC,qBACA,WAAY,KAAe,WAAW,aACxC,EAAE,OAAO,KAAK,CACf;;EAIL,MAAM,SAASF,kBAAK,QAAQ,QAAQ;AACpC,MAAI,WAAW,QAAS;AAExB,YAAU;;AAGZ,OAAM,IAAI,MACR,8EACD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACTH,MAAa,wBAAwB,OACnC,UAAwC,EAAE,KACtB;CACpB,IAAI;AAEJ,KAAIG,6BAAc,QAAQ,YAAY,CACpC,WAAU,QAAQ;KAElB,KAAI;AACF,YAAU,MAAM,gBAAgB;UACzB,OAAO;AACd,QAAM,IAAI,MACR,wFACEC,qBACA,WAAY,OAAiB,WAAW,aAC1C,EAAE,OAAO,OAAO,CACjB;;CAIL,MAAM,UAAU,QAAQ,WAAW;CAEnC,MAAM,QACJ,QAAQ,UACPC,gCAAiB,QAAQ,KAAK,GAAG,QAAQ,OAAO;CAEnD,MAAM,UAAUA,gCAAiB,QAAQ,QAAQ,GAC7C,QAAQ,UACR;CAEJ,MAAM,SACJ,QAAQ,WACPA,gCAAiB,QAAQ,OAAO,GAC7B,QAAQ,SACRF,6BAAc,QAAQ,OAAO,IAAIE,gCAAiB,QAAQ,OAAO,KAAK,GACpE,QAAQ,OAAO,OACf;CAER,MAAM,aAAaA,gCAAiB,QAAQ,SAAS,GACjD,QAAQ,SAAS,MAAM,IAAI,CAAC,KAC5BA,gCAAiB,QAAQ,WAAW,GAClC,QAAQ,WAAW,QAAQ,UAAU,GAAG,CAAC,QAAQ,UAAU,GAAG,GAC9DF,6BAAc,QAAQ,WAAW,IAC/BE,gCAAiB,QAAQ,WAAW,IAAI,GACxC,QAAQ,WAAW,IAAI,QAAQ,UAAU,GAAG,CAAC,QAAQ,UAAU,GAAG,GAClE;AAER,QAAOC,8BACL,OACA,8EACA,MAAM,SACN,8EACA,iBAAiB,QAAQ,KACzB,gBAAgB,OAAO,KACvB,oBAAoB,WAAW,KAC/B,8EACA,MACA,UAAU,KAAK,MAChB"}
1
+ {"version":3,"file":"package-banner-BHyF8RdG.cjs","names":["isNonEmptyString","path","fsExtra","EOL","isPlainObject","EOL","isNonEmptyString","joinLinesLoose"],"sources":["../src/core/get/package-json/index.ts","../src/core/generate/package-banner/index.ts"],"sourcesContent":["import \"@rzl-zone/node-only\";\n\nimport type { PackageJson } from \"type-fest\";\n\nimport path from \"node:path\";\n\nimport { isNonEmptyString } from \"@/_internal/utils/helper\";\n\nimport { fsExtra } from \"@/utils/server\";\nimport { EOL } from \"@/utils/client\";\n\n//? Types ----------------------------------------------------------------\n/** ----------------------------------------------------------------\n * * ***Configuration options for {@link getPackageJson | **`get-package-json`**}.***\n * ----------------------------------------------------------------\n */\nexport type GetPackageJsonOptions = {\n /** ----------------------------------------------------------------\n * * ***Working directory of the target project.***\n * ----------------------------------------------------------------\n *\n * This determines where the lookup for `package.json`\n * will start.\n *\n * - If provided, resolution begins from this directory.\n * - If omitted, defaults to `process.cwd()`.\n *\n * - ***Typical use cases:***\n * - CLI tools executed in a project directory.\n * - Monorepo root resolution.\n * - Custom build pipelines.\n *\n * @default process.cwd()\n *\n * @remarks\n * This should be the directory containing your project's\n * `package.json`, not the directory of this package.\n */\n cwd?: string;\n};\n\n//? Main -----------------------------------------------------------------\n/** ----------------------------------------------------------------\n * * ***Resolve and read the nearest `package.json`.***\n * ----------------------------------------------------------------\n *\n * This utility locates and loads the closest `package.json`\n * by walking up the directory tree starting from a given\n * working directory.\n *\n * - *Key characteristics:*\n * - Works in **Node ESM and CJS**.\n * - Compatible with **tsdown, rolldown, tsup, esbuild, vite, tsx, ts-node, and others**.\n * - Does **not** rely on JSON module imports.\n * - Fully typed via {@link PackageJson | **PackageJson**}.\n *\n * - *This function is intended for:*\n * - Build tools.\n * - Bundler configuration.\n * - CLI utilities.\n * - Monorepo-aware infrastructure code.\n *\n * @param options Optional resolution configuration.\n *\n * @returns The parsed contents of the resolved `package.json`.\n *\n * @example\n * ```ts\n * const pkg = await getPackageJson();\n * console.log(pkg.name, pkg.version);\n * ```\n *\n * @example\n * ```ts\n * const pkg = await getPackageJson({\n * cwd: process.cwd()\n * });\n * ```\n *\n * @throws If no `package.json` can be found.\n * @throws If the located `package.json` is invalid JSON.\n *\n * @remarks\n * - Resolution always starts from `cwd` or `process.cwd()`.\n * - Results are not cached by default.\n * - Designed for infrastructure-level usage, not hot paths.\n */\nexport const getPackageJson = async (\n options: GetPackageJsonOptions = {}\n): Promise<PackageJson> => {\n const startDir = isNonEmptyString(options.cwd)\n ? path.resolve(options.cwd)\n : process.cwd();\n\n let current = startDir;\n\n while (true) {\n const pkgPath = path.join(current, \"package.json\");\n\n if (fsExtra.existsSync(pkgPath)) {\n try {\n return JSON.parse(fsExtra.readFileSync(pkgPath, \"utf-8\"));\n } catch (err) {\n throw new Error(\n `[@rzl-zone/build-tools] - (get-package-json): Invalid package.json at '${pkgPath}'` +\n EOL +\n `Reason: ${(err as Error)?.message || \"unknown\"}`,\n { cause: err }\n );\n }\n }\n\n const parent = path.dirname(current);\n if (parent === current) break;\n\n current = parent;\n }\n\n throw new Error(\n \"[@rzl-zone/build-tools] - (get-package-json): Unable to locate package.json\"\n );\n};\n\n/** @deprecated Use {@link getPackageJson | `getPackageJson`} instead. */\nconst _getPackageJson = async (\n options: GetPackageJsonOptions = {}\n): Promise<PackageJson> => {\n return await getPackageJson(options);\n // if (options.cwd && options.from) {\n // throw new Error(\"Provide either `cwd` or `from`, not both.\");\n // }\n\n // const cwd = isNonEmptyString(options.cwd) ? options.cwd : process.cwd();\n\n // const baseUrl =\n // options.from && isNil(options.cwd)\n // ? options.from\n // : pathToFileURL(path.resolve(cwd, \"__entry__.js\"));\n\n // const createRequire = await getCreateRequire();\n // const reqPkg = createRequire(baseUrl);\n\n // let current = cwd;\n\n // while (true) {\n // const pkgPath = path.join(current, \"package.json\");\n\n // if (fsExtra.existsSync(pkgPath)) return reqPkg(pkgPath);\n\n // const parent = path.dirname(current);\n // if (parent === current) break;\n // current = parent;\n // }\n\n // throw new Error(\n // \"[@rzl-zone/build-tools] - (get-package-json): Unable to locate package.json !!!\"\n // );\n};\n","import \"@rzl-zone/node-only\";\n\nimport type { PackageJson } from \"type-fest\";\n\nimport { isNonEmptyString, isPlainObject } from \"@/_internal/utils/helper\";\n\nimport { EOL, joinLinesLoose } from \"@/utils/helper/formatter\";\nimport { getPackageJson } from \"../../get/package-json\";\n\n//? Types ----------------------------------------------------------------\n/** ----------------------------------------------------------------\n * * ***Configuration options for {@link generatePackageBanner | **`generate-package-banner`**}.***\n * ----------------------------------------------------------------\n */\nexport type GeneratePackageBannerOptions = {\n /** ----------------------------------------------------------------\n * * ***Display title shown in the banner.***\n * ----------------------------------------------------------------\n *\n * Defaults to the `name` field from `package.json`\n * when available.\n */\n title?: string;\n\n /** ----------------------------------------------------------------\n * * ***Author name displayed in the banner.***\n * ----------------------------------------------------------------\n *\n * When omitted, attempts to resolve from:\n * - `author.name`.\n * - `author` (*string*).\n */\n author?: string;\n\n /** ----------------------------------------------------------------\n * * ***Custom package metadata override.***\n * ----------------------------------------------------------------\n *\n * When provided, this object will be used instead of\n * reading from the filesystem.\n *\n * - Useful for testing or advanced build pipelines.\n */\n packageJson?: PackageJson;\n\n /** ----------------------------------------------------------------\n * * ***Append an end-of-file newline to the banner output.***\n * ----------------------------------------------------------------\n *\n * Controls whether the generated banner is terminated with\n * an end-of-file (EOF) newline character.\n *\n * When enabled, a trailing newline is appended to ensure:\n * - POSIX-compliant text files.\n * - Clean concatenation with subsequent source content.\n * - Consistent formatting during code injection.\n *\n * @default true\n */\n withEof?: boolean;\n};\n\n//? Main -----------------------------------------------------------------\n/** ----------------------------------------------------------------\n * * ***Generate a standardized top banner from `package.json`.***\n * ----------------------------------------------------------------\n *\n * This utility generates a formatted banner comment suitable\n * for insertion at the top of bundled output files.\n *\n * By default, it automatically locates and reads the nearest\n * `package.json` file, you may also provide a custom package object\n * through the options parameter.\n *\n * - *Banner features:*\n * - Reads metadata from the nearest `package.json`.\n * - Supports custom package metadata via options.\n * - Provides safe fallbacks for missing fields.\n * - Produces a consistent, readable comment block.\n * - Normalizes repository URLs when possible.\n *\n * - *This function is intended for:*\n * - Bundler banners (tsdown, tsup, rollup, esbuild, etc).\n * - Generated build artifacts.\n * - Distributed library outputs.\n *\n * @param {GeneratePackageBannerOptions} [options]\n * Optional banner configuration.\n *\n * @returns {Promise<string>}\n * A formatted banner comment string.\n *\n * @throws {Error}\n * If no `package.json` can be found.\n *\n * @throws {Error}\n * If the resolved `package.json` contains invalid JSON.\n *\n * @example\n * ```ts\n * const banner = await generatePackageBanner({\n * title: \"Rzl Build Tools\",\n * author: \"Rzl\"\n * });\n * ```\n *\n * @example\n * ```ts\n * const banner = await generatePackageBanner();\n * ```\n */\nexport const generatePackageBanner = async (\n options: GeneratePackageBannerOptions = {}\n): Promise<string> => {\n let pkgJson: PackageJson | undefined;\n\n if (isPlainObject(options.packageJson)) {\n pkgJson = options.packageJson;\n } else {\n try {\n pkgJson = await getPackageJson();\n } catch (error) {\n throw new Error(\n \"[@rzl-zone/build-tools] - (generate-package-banner): Failed to resolve package.json\" +\n EOL +\n `Reason: ${(error as Error)?.message || \"unknown\"}`,\n { cause: error }\n );\n }\n }\n\n const withEof = options.withEof ?? true;\n\n const title =\n options.title ??\n (isNonEmptyString(pkgJson.name) ? pkgJson.name : \"Unknown Package\");\n\n const version = isNonEmptyString(pkgJson.version)\n ? pkgJson.version\n : \"Unknown\";\n\n const author =\n options.author ??\n (isNonEmptyString(pkgJson.author)\n ? pkgJson.author\n : isPlainObject(pkgJson.author) && isNonEmptyString(pkgJson.author.name)\n ? pkgJson.author.name\n : \"Unknown\");\n\n const repository = isNonEmptyString(pkgJson.homepage)\n ? pkgJson.homepage.split(\"#\")[0]\n : isNonEmptyString(pkgJson.repository)\n ? pkgJson.repository.replace(/^git\\+/, \"\").replace(/\\.git$/, \"\")\n : isPlainObject(pkgJson.repository) &&\n isNonEmptyString(pkgJson.repository.url)\n ? pkgJson.repository.url.replace(/^git\\+/, \"\").replace(/\\.git$/, \"\")\n : \"Unknown\";\n\n return joinLinesLoose(\n \"/*!\",\n \"* ========================================================================\",\n `* ${title}`,\n \"* ------------------------------------------------------------------------\",\n `* Version: \\`${version}\\``,\n `* Author: \\`${author}\\``,\n `* Repository: \\`${repository}\\``,\n \"* ========================================================================\",\n \"*/\",\n withEof ? \"\" : false\n );\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAuFA,MAAa,iBAAiB,OAC5B,UAAiC,EAAE,KACV;CAKzB,IAAI,UAJaA,gCAAiB,QAAQ,IAAI,GAC1CC,kBAAK,QAAQ,QAAQ,IAAI,GACzB,QAAQ,KAAK;AAIjB,QAAO,MAAM;EACX,MAAM,UAAUA,kBAAK,KAAK,SAAS,eAAe;AAElD,MAAIC,uBAAQ,WAAW,QAAQ,CAC7B,KAAI;AACF,UAAO,KAAK,MAAMA,uBAAQ,aAAa,SAAS,QAAQ,CAAC;WAClD,KAAK;AACZ,SAAM,IAAI,MACR,0EAA0E,QAAQ,KAChFC,qBACA,WAAY,KAAe,WAAW,aACxC,EAAE,OAAO,KAAK,CACf;;EAIL,MAAM,SAASF,kBAAK,QAAQ,QAAQ;AACpC,MAAI,WAAW,QAAS;AAExB,YAAU;;AAGZ,OAAM,IAAI,MACR,8EACD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACTH,MAAa,wBAAwB,OACnC,UAAwC,EAAE,KACtB;CACpB,IAAI;AAEJ,KAAIG,6BAAc,QAAQ,YAAY,CACpC,WAAU,QAAQ;KAElB,KAAI;AACF,YAAU,MAAM,gBAAgB;UACzB,OAAO;AACd,QAAM,IAAI,MACR,wFACEC,qBACA,WAAY,OAAiB,WAAW,aAC1C,EAAE,OAAO,OAAO,CACjB;;CAIL,MAAM,UAAU,QAAQ,WAAW;CAEnC,MAAM,QACJ,QAAQ,UACPC,gCAAiB,QAAQ,KAAK,GAAG,QAAQ,OAAO;CAEnD,MAAM,UAAUA,gCAAiB,QAAQ,QAAQ,GAC7C,QAAQ,UACR;CAEJ,MAAM,SACJ,QAAQ,WACPA,gCAAiB,QAAQ,OAAO,GAC7B,QAAQ,SACRF,6BAAc,QAAQ,OAAO,IAAIE,gCAAiB,QAAQ,OAAO,KAAK,GACpE,QAAQ,OAAO,OACf;CAER,MAAM,aAAaA,gCAAiB,QAAQ,SAAS,GACjD,QAAQ,SAAS,MAAM,IAAI,CAAC,KAC5BA,gCAAiB,QAAQ,WAAW,GAClC,QAAQ,WAAW,QAAQ,UAAU,GAAG,CAAC,QAAQ,UAAU,GAAG,GAC9DF,6BAAc,QAAQ,WAAW,IAC/BE,gCAAiB,QAAQ,WAAW,IAAI,GACxC,QAAQ,WAAW,IAAI,QAAQ,UAAU,GAAG,CAAC,QAAQ,UAAU,GAAG,GAClE;AAER,QAAOC,8BACL,OACA,8EACA,MAAM,SACN,8EACA,iBAAiB,QAAQ,KACzB,gBAAgB,OAAO,KACvB,oBAAoB,WAAW,KAC/B,8EACA,MACA,UAAU,KAAK,MAChB"}
@@ -2,15 +2,15 @@
2
2
  * ========================================================================
3
3
  * @rzl-zone/build-tools
4
4
  * ------------------------------------------------------------------------
5
- * Version: `0.0.9`
5
+ * Version: `0.0.10`
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 { l as isNonEmptyString, p as isPlainObject } from "./helper-D11A-ZKL.js";
12
- import { n as fsExtra } from "./server-1H2HFAbi.js";
13
- import { n as EOL, s as joinLinesLoose } from "./client-DUlrjus0.js";
11
+ import { l as isNonEmptyString, p as isPlainObject } from "./helper-CWU8QYq3.js";
12
+ import { n as fsExtra } from "./server-BA7ruG1h.js";
13
+ import { n as EOL, s as joinLinesLoose } from "./client-BmfdVI22.js";
14
14
  import "@rzl-zone/node-only";
15
15
  import path from "node:path";
16
16
  const getPackageJson = async (options = {}) => {
@@ -44,4 +44,4 @@ const generatePackageBanner = async (options = {}) => {
44
44
  return joinLinesLoose("/*!", "* ========================================================================", `* ${title}`, "* ------------------------------------------------------------------------", `* Version: \`${version}\``, `* Author: \`${author}\``, `* Repository: \`${repository}\``, "* ========================================================================", "*/", withEof ? "" : false);
45
45
  };
46
46
  export { getPackageJson as n, generatePackageBanner as t };
47
- //# sourceMappingURL=package-banner-vwqcAX8E.js.map
47
+ //# sourceMappingURL=package-banner-BmLNyezO.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"package-banner-vwqcAX8E.js","names":[],"sources":["../src/core/get/package-json/index.ts","../src/core/generate/package-banner/index.ts"],"sourcesContent":["import \"@rzl-zone/node-only\";\n\nimport type { PackageJson } from \"type-fest\";\n\nimport path from \"node:path\";\n\nimport { isNonEmptyString } from \"@/_internal/utils/helper\";\n\nimport { fsExtra } from \"@/utils/server\";\nimport { EOL } from \"@/utils/client\";\n\n//? Types ----------------------------------------------------------------\n/** ----------------------------------------------------------------\n * * ***Configuration options for {@link getPackageJson | **`get-package-json`**}.***\n * ----------------------------------------------------------------\n */\nexport type GetPackageJsonOptions = {\n /** ----------------------------------------------------------------\n * * ***Working directory of the target project.***\n * ----------------------------------------------------------------\n *\n * This determines where the lookup for `package.json`\n * will start.\n *\n * - If provided, resolution begins from this directory.\n * - If omitted, defaults to `process.cwd()`.\n *\n * - ***Typical use cases:***\n * - CLI tools executed in a project directory.\n * - Monorepo root resolution.\n * - Custom build pipelines.\n *\n * @default process.cwd()\n *\n * @remarks\n * This should be the directory containing your project's\n * `package.json`, not the directory of this package.\n */\n cwd?: string;\n};\n\n//? Main -----------------------------------------------------------------\n/** ----------------------------------------------------------------\n * * ***Resolve and read the nearest `package.json`.***\n * ----------------------------------------------------------------\n *\n * This utility locates and loads the closest `package.json`\n * by walking up the directory tree starting from a given\n * working directory.\n *\n * - *Key characteristics:*\n * - Works in **Node ESM and CJS**.\n * - Compatible with **tsdown, rolldown, tsup, esbuild, vite, tsx, ts-node, and others**.\n * - Does **not** rely on JSON module imports.\n * - Fully typed via {@link PackageJson | **PackageJson**}.\n *\n * - *This function is intended for:*\n * - Build tools.\n * - Bundler configuration.\n * - CLI utilities.\n * - Monorepo-aware infrastructure code.\n *\n * @param options Optional resolution configuration.\n *\n * @returns The parsed contents of the resolved `package.json`.\n *\n * @example\n * ```ts\n * const pkg = await getPackageJson();\n * console.log(pkg.name, pkg.version);\n * ```\n *\n * @example\n * ```ts\n * const pkg = await getPackageJson({\n * cwd: process.cwd()\n * });\n * ```\n *\n * @throws If no `package.json` can be found.\n * @throws If the located `package.json` is invalid JSON.\n *\n * @remarks\n * - Resolution always starts from `cwd` or `process.cwd()`.\n * - Results are not cached by default.\n * - Designed for infrastructure-level usage, not hot paths.\n */\nexport const getPackageJson = async (\n options: GetPackageJsonOptions = {}\n): Promise<PackageJson> => {\n const startDir = isNonEmptyString(options.cwd)\n ? path.resolve(options.cwd)\n : process.cwd();\n\n let current = startDir;\n\n while (true) {\n const pkgPath = path.join(current, \"package.json\");\n\n if (fsExtra.existsSync(pkgPath)) {\n try {\n return JSON.parse(fsExtra.readFileSync(pkgPath, \"utf-8\"));\n } catch (err) {\n throw new Error(\n `[@rzl-zone/build-tools] - (get-package-json): Invalid package.json at '${pkgPath}'` +\n EOL +\n `Reason: ${(err as Error)?.message || \"unknown\"}`,\n { cause: err }\n );\n }\n }\n\n const parent = path.dirname(current);\n if (parent === current) break;\n\n current = parent;\n }\n\n throw new Error(\n \"[@rzl-zone/build-tools] - (get-package-json): Unable to locate package.json\"\n );\n};\n\n/** @deprecated Use {@link getPackageJson | `getPackageJson`} instead. */\nconst _getPackageJson = async (\n options: GetPackageJsonOptions = {}\n): Promise<PackageJson> => {\n return await getPackageJson(options);\n // if (options.cwd && options.from) {\n // throw new Error(\"Provide either `cwd` or `from`, not both.\");\n // }\n\n // const cwd = isNonEmptyString(options.cwd) ? options.cwd : process.cwd();\n\n // const baseUrl =\n // options.from && isNil(options.cwd)\n // ? options.from\n // : pathToFileURL(path.resolve(cwd, \"__entry__.js\"));\n\n // const createRequire = await getCreateRequire();\n // const reqPkg = createRequire(baseUrl);\n\n // let current = cwd;\n\n // while (true) {\n // const pkgPath = path.join(current, \"package.json\");\n\n // if (fsExtra.existsSync(pkgPath)) return reqPkg(pkgPath);\n\n // const parent = path.dirname(current);\n // if (parent === current) break;\n // current = parent;\n // }\n\n // throw new Error(\n // \"[@rzl-zone/build-tools] - (get-package-json): Unable to locate package.json !!!\"\n // );\n};\n","import \"@rzl-zone/node-only\";\n\nimport type { PackageJson } from \"type-fest\";\n\nimport { isNonEmptyString, isPlainObject } from \"@/_internal/utils/helper\";\n\nimport { EOL, joinLinesLoose } from \"@/utils/helper/formatter\";\nimport { getPackageJson } from \"../../get/package-json\";\n\n//? Types ----------------------------------------------------------------\n/** ----------------------------------------------------------------\n * * ***Configuration options for {@link generatePackageBanner | **`generate-package-banner`**}.***\n * ----------------------------------------------------------------\n */\nexport type GeneratePackageBannerOptions = {\n /** ----------------------------------------------------------------\n * * ***Display title shown in the banner.***\n * ----------------------------------------------------------------\n *\n * Defaults to the `name` field from `package.json`\n * when available.\n */\n title?: string;\n\n /** ----------------------------------------------------------------\n * * ***Author name displayed in the banner.***\n * ----------------------------------------------------------------\n *\n * When omitted, attempts to resolve from:\n * - `author.name`.\n * - `author` (*string*).\n */\n author?: string;\n\n /** ----------------------------------------------------------------\n * * ***Custom package metadata override.***\n * ----------------------------------------------------------------\n *\n * When provided, this object will be used instead of\n * reading from the filesystem.\n *\n * - Useful for testing or advanced build pipelines.\n */\n packageJson?: PackageJson;\n\n /** ----------------------------------------------------------------\n * * ***Append an end-of-file newline to the banner output.***\n * ----------------------------------------------------------------\n *\n * Controls whether the generated banner is terminated with\n * an end-of-file (EOF) newline character.\n *\n * When enabled, a trailing newline is appended to ensure:\n * - POSIX-compliant text files.\n * - Clean concatenation with subsequent source content.\n * - Consistent formatting during code injection.\n *\n * @default true\n */\n withEof?: boolean;\n};\n\n//? Main -----------------------------------------------------------------\n/** ----------------------------------------------------------------\n * * ***Generate a standardized top banner from `package.json`.***\n * ----------------------------------------------------------------\n *\n * This utility generates a formatted banner comment suitable\n * for insertion at the top of bundled output files.\n *\n * By default, it automatically locates and reads the nearest\n * `package.json` file, you may also provide a custom package object\n * through the options parameter.\n *\n * - *Banner features:*\n * - Reads metadata from the nearest `package.json`.\n * - Supports custom package metadata via options.\n * - Provides safe fallbacks for missing fields.\n * - Produces a consistent, readable comment block.\n * - Normalizes repository URLs when possible.\n *\n * - *This function is intended for:*\n * - Bundler banners (tsdown, tsup, rollup, esbuild, etc).\n * - Generated build artifacts.\n * - Distributed library outputs.\n *\n * @param {GeneratePackageBannerOptions} [options]\n * Optional banner configuration.\n *\n * @returns {Promise<string>}\n * A formatted banner comment string.\n *\n * @throws {Error}\n * If no `package.json` can be found.\n *\n * @throws {Error}\n * If the resolved `package.json` contains invalid JSON.\n *\n * @example\n * ```ts\n * const banner = await generatePackageBanner({\n * title: \"Rzl Build Tools\",\n * author: \"Rzl\"\n * });\n * ```\n *\n * @example\n * ```ts\n * const banner = await generatePackageBanner();\n * ```\n */\nexport const generatePackageBanner = async (\n options: GeneratePackageBannerOptions = {}\n): Promise<string> => {\n let pkgJson: PackageJson | undefined;\n\n if (isPlainObject(options.packageJson)) {\n pkgJson = options.packageJson;\n } else {\n try {\n pkgJson = await getPackageJson();\n } catch (error) {\n throw new Error(\n \"[@rzl-zone/build-tools] - (generate-package-banner): Failed to resolve package.json\" +\n EOL +\n `Reason: ${(error as Error)?.message || \"unknown\"}`,\n { cause: error }\n );\n }\n }\n\n const withEof = options.withEof ?? true;\n\n const title =\n options.title ??\n (isNonEmptyString(pkgJson.name) ? pkgJson.name : \"Unknown Package\");\n\n const version = isNonEmptyString(pkgJson.version)\n ? pkgJson.version\n : \"Unknown\";\n\n const author =\n options.author ??\n (isNonEmptyString(pkgJson.author)\n ? pkgJson.author\n : isPlainObject(pkgJson.author) && isNonEmptyString(pkgJson.author.name)\n ? pkgJson.author.name\n : \"Unknown\");\n\n const repository = isNonEmptyString(pkgJson.homepage)\n ? pkgJson.homepage.split(\"#\")[0]\n : isNonEmptyString(pkgJson.repository)\n ? pkgJson.repository.replace(/^git\\+/, \"\").replace(/\\.git$/, \"\")\n : isPlainObject(pkgJson.repository) &&\n isNonEmptyString(pkgJson.repository.url)\n ? pkgJson.repository.url.replace(/^git\\+/, \"\").replace(/\\.git$/, \"\")\n : \"Unknown\";\n\n return joinLinesLoose(\n \"/*!\",\n \"* ========================================================================\",\n `* ${title}`,\n \"* ------------------------------------------------------------------------\",\n `* Version: \\`${version}\\``,\n `* Author: \\`${author}\\``,\n `* Repository: \\`${repository}\\``,\n \"* ========================================================================\",\n \"*/\",\n withEof ? \"\" : false\n );\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAuFA,MAAa,iBAAiB,OAC5B,UAAiC,EAAE,KACV;CAKzB,IAAI,UAJa,iBAAiB,QAAQ,IAAI,GAC1C,KAAK,QAAQ,QAAQ,IAAI,GACzB,QAAQ,KAAK;AAIjB,QAAO,MAAM;EACX,MAAM,UAAU,KAAK,KAAK,SAAS,eAAe;AAElD,MAAI,QAAQ,WAAW,QAAQ,CAC7B,KAAI;AACF,UAAO,KAAK,MAAM,QAAQ,aAAa,SAAS,QAAQ,CAAC;WAClD,KAAK;AACZ,SAAM,IAAI,MACR,0EAA0E,QAAQ,KAChF,MACA,WAAY,KAAe,WAAW,aACxC,EAAE,OAAO,KAAK,CACf;;EAIL,MAAM,SAAS,KAAK,QAAQ,QAAQ;AACpC,MAAI,WAAW,QAAS;AAExB,YAAU;;AAGZ,OAAM,IAAI,MACR,8EACD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACTH,MAAa,wBAAwB,OACnC,UAAwC,EAAE,KACtB;CACpB,IAAI;AAEJ,KAAI,cAAc,QAAQ,YAAY,CACpC,WAAU,QAAQ;KAElB,KAAI;AACF,YAAU,MAAM,gBAAgB;UACzB,OAAO;AACd,QAAM,IAAI,MACR,wFACE,MACA,WAAY,OAAiB,WAAW,aAC1C,EAAE,OAAO,OAAO,CACjB;;CAIL,MAAM,UAAU,QAAQ,WAAW;CAEnC,MAAM,QACJ,QAAQ,UACP,iBAAiB,QAAQ,KAAK,GAAG,QAAQ,OAAO;CAEnD,MAAM,UAAU,iBAAiB,QAAQ,QAAQ,GAC7C,QAAQ,UACR;CAEJ,MAAM,SACJ,QAAQ,WACP,iBAAiB,QAAQ,OAAO,GAC7B,QAAQ,SACR,cAAc,QAAQ,OAAO,IAAI,iBAAiB,QAAQ,OAAO,KAAK,GACpE,QAAQ,OAAO,OACf;CAER,MAAM,aAAa,iBAAiB,QAAQ,SAAS,GACjD,QAAQ,SAAS,MAAM,IAAI,CAAC,KAC5B,iBAAiB,QAAQ,WAAW,GAClC,QAAQ,WAAW,QAAQ,UAAU,GAAG,CAAC,QAAQ,UAAU,GAAG,GAC9D,cAAc,QAAQ,WAAW,IAC/B,iBAAiB,QAAQ,WAAW,IAAI,GACxC,QAAQ,WAAW,IAAI,QAAQ,UAAU,GAAG,CAAC,QAAQ,UAAU,GAAG,GAClE;AAER,QAAO,eACL,OACA,8EACA,MAAM,SACN,8EACA,iBAAiB,QAAQ,KACzB,gBAAgB,OAAO,KACvB,oBAAoB,WAAW,KAC/B,8EACA,MACA,UAAU,KAAK,MAChB"}
1
+ {"version":3,"file":"package-banner-BmLNyezO.js","names":[],"sources":["../src/core/get/package-json/index.ts","../src/core/generate/package-banner/index.ts"],"sourcesContent":["import \"@rzl-zone/node-only\";\n\nimport type { PackageJson } from \"type-fest\";\n\nimport path from \"node:path\";\n\nimport { isNonEmptyString } from \"@/_internal/utils/helper\";\n\nimport { fsExtra } from \"@/utils/server\";\nimport { EOL } from \"@/utils/client\";\n\n//? Types ----------------------------------------------------------------\n/** ----------------------------------------------------------------\n * * ***Configuration options for {@link getPackageJson | **`get-package-json`**}.***\n * ----------------------------------------------------------------\n */\nexport type GetPackageJsonOptions = {\n /** ----------------------------------------------------------------\n * * ***Working directory of the target project.***\n * ----------------------------------------------------------------\n *\n * This determines where the lookup for `package.json`\n * will start.\n *\n * - If provided, resolution begins from this directory.\n * - If omitted, defaults to `process.cwd()`.\n *\n * - ***Typical use cases:***\n * - CLI tools executed in a project directory.\n * - Monorepo root resolution.\n * - Custom build pipelines.\n *\n * @default process.cwd()\n *\n * @remarks\n * This should be the directory containing your project's\n * `package.json`, not the directory of this package.\n */\n cwd?: string;\n};\n\n//? Main -----------------------------------------------------------------\n/** ----------------------------------------------------------------\n * * ***Resolve and read the nearest `package.json`.***\n * ----------------------------------------------------------------\n *\n * This utility locates and loads the closest `package.json`\n * by walking up the directory tree starting from a given\n * working directory.\n *\n * - *Key characteristics:*\n * - Works in **Node ESM and CJS**.\n * - Compatible with **tsdown, rolldown, tsup, esbuild, vite, tsx, ts-node, and others**.\n * - Does **not** rely on JSON module imports.\n * - Fully typed via {@link PackageJson | **PackageJson**}.\n *\n * - *This function is intended for:*\n * - Build tools.\n * - Bundler configuration.\n * - CLI utilities.\n * - Monorepo-aware infrastructure code.\n *\n * @param options Optional resolution configuration.\n *\n * @returns The parsed contents of the resolved `package.json`.\n *\n * @example\n * ```ts\n * const pkg = await getPackageJson();\n * console.log(pkg.name, pkg.version);\n * ```\n *\n * @example\n * ```ts\n * const pkg = await getPackageJson({\n * cwd: process.cwd()\n * });\n * ```\n *\n * @throws If no `package.json` can be found.\n * @throws If the located `package.json` is invalid JSON.\n *\n * @remarks\n * - Resolution always starts from `cwd` or `process.cwd()`.\n * - Results are not cached by default.\n * - Designed for infrastructure-level usage, not hot paths.\n */\nexport const getPackageJson = async (\n options: GetPackageJsonOptions = {}\n): Promise<PackageJson> => {\n const startDir = isNonEmptyString(options.cwd)\n ? path.resolve(options.cwd)\n : process.cwd();\n\n let current = startDir;\n\n while (true) {\n const pkgPath = path.join(current, \"package.json\");\n\n if (fsExtra.existsSync(pkgPath)) {\n try {\n return JSON.parse(fsExtra.readFileSync(pkgPath, \"utf-8\"));\n } catch (err) {\n throw new Error(\n `[@rzl-zone/build-tools] - (get-package-json): Invalid package.json at '${pkgPath}'` +\n EOL +\n `Reason: ${(err as Error)?.message || \"unknown\"}`,\n { cause: err }\n );\n }\n }\n\n const parent = path.dirname(current);\n if (parent === current) break;\n\n current = parent;\n }\n\n throw new Error(\n \"[@rzl-zone/build-tools] - (get-package-json): Unable to locate package.json\"\n );\n};\n\n/** @deprecated Use {@link getPackageJson | `getPackageJson`} instead. */\nconst _getPackageJson = async (\n options: GetPackageJsonOptions = {}\n): Promise<PackageJson> => {\n return await getPackageJson(options);\n // if (options.cwd && options.from) {\n // throw new Error(\"Provide either `cwd` or `from`, not both.\");\n // }\n\n // const cwd = isNonEmptyString(options.cwd) ? options.cwd : process.cwd();\n\n // const baseUrl =\n // options.from && isNil(options.cwd)\n // ? options.from\n // : pathToFileURL(path.resolve(cwd, \"__entry__.js\"));\n\n // const createRequire = await getCreateRequire();\n // const reqPkg = createRequire(baseUrl);\n\n // let current = cwd;\n\n // while (true) {\n // const pkgPath = path.join(current, \"package.json\");\n\n // if (fsExtra.existsSync(pkgPath)) return reqPkg(pkgPath);\n\n // const parent = path.dirname(current);\n // if (parent === current) break;\n // current = parent;\n // }\n\n // throw new Error(\n // \"[@rzl-zone/build-tools] - (get-package-json): Unable to locate package.json !!!\"\n // );\n};\n","import \"@rzl-zone/node-only\";\n\nimport type { PackageJson } from \"type-fest\";\n\nimport { isNonEmptyString, isPlainObject } from \"@/_internal/utils/helper\";\n\nimport { EOL, joinLinesLoose } from \"@/utils/helper/formatter\";\nimport { getPackageJson } from \"../../get/package-json\";\n\n//? Types ----------------------------------------------------------------\n/** ----------------------------------------------------------------\n * * ***Configuration options for {@link generatePackageBanner | **`generate-package-banner`**}.***\n * ----------------------------------------------------------------\n */\nexport type GeneratePackageBannerOptions = {\n /** ----------------------------------------------------------------\n * * ***Display title shown in the banner.***\n * ----------------------------------------------------------------\n *\n * Defaults to the `name` field from `package.json`\n * when available.\n */\n title?: string;\n\n /** ----------------------------------------------------------------\n * * ***Author name displayed in the banner.***\n * ----------------------------------------------------------------\n *\n * When omitted, attempts to resolve from:\n * - `author.name`.\n * - `author` (*string*).\n */\n author?: string;\n\n /** ----------------------------------------------------------------\n * * ***Custom package metadata override.***\n * ----------------------------------------------------------------\n *\n * When provided, this object will be used instead of\n * reading from the filesystem.\n *\n * - Useful for testing or advanced build pipelines.\n */\n packageJson?: PackageJson;\n\n /** ----------------------------------------------------------------\n * * ***Append an end-of-file newline to the banner output.***\n * ----------------------------------------------------------------\n *\n * Controls whether the generated banner is terminated with\n * an end-of-file (EOF) newline character.\n *\n * When enabled, a trailing newline is appended to ensure:\n * - POSIX-compliant text files.\n * - Clean concatenation with subsequent source content.\n * - Consistent formatting during code injection.\n *\n * @default true\n */\n withEof?: boolean;\n};\n\n//? Main -----------------------------------------------------------------\n/** ----------------------------------------------------------------\n * * ***Generate a standardized top banner from `package.json`.***\n * ----------------------------------------------------------------\n *\n * This utility generates a formatted banner comment suitable\n * for insertion at the top of bundled output files.\n *\n * By default, it automatically locates and reads the nearest\n * `package.json` file, you may also provide a custom package object\n * through the options parameter.\n *\n * - *Banner features:*\n * - Reads metadata from the nearest `package.json`.\n * - Supports custom package metadata via options.\n * - Provides safe fallbacks for missing fields.\n * - Produces a consistent, readable comment block.\n * - Normalizes repository URLs when possible.\n *\n * - *This function is intended for:*\n * - Bundler banners (tsdown, tsup, rollup, esbuild, etc).\n * - Generated build artifacts.\n * - Distributed library outputs.\n *\n * @param {GeneratePackageBannerOptions} [options]\n * Optional banner configuration.\n *\n * @returns {Promise<string>}\n * A formatted banner comment string.\n *\n * @throws {Error}\n * If no `package.json` can be found.\n *\n * @throws {Error}\n * If the resolved `package.json` contains invalid JSON.\n *\n * @example\n * ```ts\n * const banner = await generatePackageBanner({\n * title: \"Rzl Build Tools\",\n * author: \"Rzl\"\n * });\n * ```\n *\n * @example\n * ```ts\n * const banner = await generatePackageBanner();\n * ```\n */\nexport const generatePackageBanner = async (\n options: GeneratePackageBannerOptions = {}\n): Promise<string> => {\n let pkgJson: PackageJson | undefined;\n\n if (isPlainObject(options.packageJson)) {\n pkgJson = options.packageJson;\n } else {\n try {\n pkgJson = await getPackageJson();\n } catch (error) {\n throw new Error(\n \"[@rzl-zone/build-tools] - (generate-package-banner): Failed to resolve package.json\" +\n EOL +\n `Reason: ${(error as Error)?.message || \"unknown\"}`,\n { cause: error }\n );\n }\n }\n\n const withEof = options.withEof ?? true;\n\n const title =\n options.title ??\n (isNonEmptyString(pkgJson.name) ? pkgJson.name : \"Unknown Package\");\n\n const version = isNonEmptyString(pkgJson.version)\n ? pkgJson.version\n : \"Unknown\";\n\n const author =\n options.author ??\n (isNonEmptyString(pkgJson.author)\n ? pkgJson.author\n : isPlainObject(pkgJson.author) && isNonEmptyString(pkgJson.author.name)\n ? pkgJson.author.name\n : \"Unknown\");\n\n const repository = isNonEmptyString(pkgJson.homepage)\n ? pkgJson.homepage.split(\"#\")[0]\n : isNonEmptyString(pkgJson.repository)\n ? pkgJson.repository.replace(/^git\\+/, \"\").replace(/\\.git$/, \"\")\n : isPlainObject(pkgJson.repository) &&\n isNonEmptyString(pkgJson.repository.url)\n ? pkgJson.repository.url.replace(/^git\\+/, \"\").replace(/\\.git$/, \"\")\n : \"Unknown\";\n\n return joinLinesLoose(\n \"/*!\",\n \"* ========================================================================\",\n `* ${title}`,\n \"* ------------------------------------------------------------------------\",\n `* Version: \\`${version}\\``,\n `* Author: \\`${author}\\``,\n `* Repository: \\`${repository}\\``,\n \"* ========================================================================\",\n \"*/\",\n withEof ? \"\" : false\n );\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAuFA,MAAa,iBAAiB,OAC5B,UAAiC,EAAE,KACV;CAKzB,IAAI,UAJa,iBAAiB,QAAQ,IAAI,GAC1C,KAAK,QAAQ,QAAQ,IAAI,GACzB,QAAQ,KAAK;AAIjB,QAAO,MAAM;EACX,MAAM,UAAU,KAAK,KAAK,SAAS,eAAe;AAElD,MAAI,QAAQ,WAAW,QAAQ,CAC7B,KAAI;AACF,UAAO,KAAK,MAAM,QAAQ,aAAa,SAAS,QAAQ,CAAC;WAClD,KAAK;AACZ,SAAM,IAAI,MACR,0EAA0E,QAAQ,KAChF,MACA,WAAY,KAAe,WAAW,aACxC,EAAE,OAAO,KAAK,CACf;;EAIL,MAAM,SAAS,KAAK,QAAQ,QAAQ;AACpC,MAAI,WAAW,QAAS;AAExB,YAAU;;AAGZ,OAAM,IAAI,MACR,8EACD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACTH,MAAa,wBAAwB,OACnC,UAAwC,EAAE,KACtB;CACpB,IAAI;AAEJ,KAAI,cAAc,QAAQ,YAAY,CACpC,WAAU,QAAQ;KAElB,KAAI;AACF,YAAU,MAAM,gBAAgB;UACzB,OAAO;AACd,QAAM,IAAI,MACR,wFACE,MACA,WAAY,OAAiB,WAAW,aAC1C,EAAE,OAAO,OAAO,CACjB;;CAIL,MAAM,UAAU,QAAQ,WAAW;CAEnC,MAAM,QACJ,QAAQ,UACP,iBAAiB,QAAQ,KAAK,GAAG,QAAQ,OAAO;CAEnD,MAAM,UAAU,iBAAiB,QAAQ,QAAQ,GAC7C,QAAQ,UACR;CAEJ,MAAM,SACJ,QAAQ,WACP,iBAAiB,QAAQ,OAAO,GAC7B,QAAQ,SACR,cAAc,QAAQ,OAAO,IAAI,iBAAiB,QAAQ,OAAO,KAAK,GACpE,QAAQ,OAAO,OACf;CAER,MAAM,aAAa,iBAAiB,QAAQ,SAAS,GACjD,QAAQ,SAAS,MAAM,IAAI,CAAC,KAC5B,iBAAiB,QAAQ,WAAW,GAClC,QAAQ,WAAW,QAAQ,UAAU,GAAG,CAAC,QAAQ,UAAU,GAAG,GAC9D,cAAc,QAAQ,WAAW,IAC/B,iBAAiB,QAAQ,WAAW,IAAI,GACxC,QAAQ,WAAW,IAAI,QAAQ,UAAU,GAAG,CAAC,QAAQ,UAAU,GAAG,GAClE;AAER,QAAO,eACL,OACA,8EACA,MAAM,SACN,8EACA,iBAAiB,QAAQ,KACzB,gBAAgB,OAAO,KACvB,oBAAoB,WAAW,KAC/B,8EACA,MACA,UAAU,KAAK,MAChB"}
@@ -2,13 +2,13 @@
2
2
  * ========================================================================
3
3
  * @rzl-zone/build-tools
4
4
  * ------------------------------------------------------------------------
5
- * Version: `0.0.9`
5
+ * Version: `0.0.10`
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 { p as isPlainObject, y as safeStableStringify } from "./helper-D11A-ZKL.js";
11
+ import { p as isPlainObject, y as safeStableStringify } from "./helper-CWU8QYq3.js";
12
12
  import "@rzl-zone/node-only";
13
13
  import os from "node:os";
14
14
  import _fastGlob from "fast-glob";
@@ -139,4 +139,4 @@ const ICONS = Object.freeze(USE_EMOJI ? emojiIcons : asciiIcons);
139
139
  const fsExtra = _fsExtra;
140
140
  const fastGlob = _fastGlob;
141
141
  export { resolvePatternOptions as a, defaultPatternOptions as i, fsExtra as n, sourceOfPatternOptions as o, ICONS as r, fastGlob as t };
142
- //# sourceMappingURL=server-1H2HFAbi.js.map
142
+ //# sourceMappingURL=server-BA7ruG1h.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"server-1H2HFAbi.js","names":[],"sources":["../src/_internal/libs/fast-globe-options.ts","../src/utils/helper/icons.ts","../src/utils/server.ts"],"sourcesContent":["import \"@rzl-zone/node-only\";\n\nimport type { OmitStrict, Prettify } from \"../types/extra\";\n\nimport os from \"node:os\";\nimport * as fg from \"fast-glob\";\n\nimport {\n isPlainObject,\n safeStableStringify,\n type SafeStableStringifyOptions\n} from \"@/_internal/utils/helper\";\n\ntype IfTrueGeneric<T extends boolean, K> = T extends true ? K : never;\n\n/** ----------------------------------------------------------------\n * * ***Supported pattern matching options.***\n * ----------------------------------------------------------------\n * Defines the subset of {@link fg | `fast-glob`} options exposed by\n * this module for pattern-based file resolution.\n *\n * This type intentionally omits several low-level or environment-\n * controlled fields to ensure predictable and safe behavior.\n *\n * ----------------------------------------------------------------\n *\n * *Excluded options (managed internally):*\n *\n * - `fs`\n * - `cwd`\n * - `stats`\n * - `deep`\n * - `extglob`\n * - `suppressErrors`\n * - `braceExpansion`\n *\n * These fields are controlled by the runtime environment and should\n * not be overridden by consumers.\n *\n * ----------------------------------------------------------------\n * @template FilesOnly\n * When `true`, directory filtering options (`onlyFiles`, `onlyDirectories`)\n * are removed from the public API surface, preventing consumers from\n * modifying directory matching behavior.\n *\n * @template ForceUnique\n * When `true`, the `unique` option is removed from the public API to enforce internal uniqueness handling.\n *\n * This allows higher-level utilities to guarantee that matched results\n * are always deduplicated.\n *\n * ----------------------------------------------------------------\n *\n * This type serves as the public configuration contract used when\n * resolving glob patterns.\n */\nexport type PatternOptions<\n FilesOnly extends boolean = false,\n ForceUnique extends boolean = false\n> = OmitStrict<\n fg.Options,\n | \"fs\"\n | \"cwd\"\n | \"stats\"\n | \"deep\"\n | \"extglob\"\n | \"suppressErrors\"\n | \"braceExpansion\"\n | \"dot\"\n | IfTrueGeneric<FilesOnly, \"onlyFiles\" | \"onlyDirectories\">\n | IfTrueGeneric<ForceUnique, \"unique\">,\n { skipPrettify: true }\n> & {\n /** Allow patterns to match entries that begin with a period (`.`).\n *\n * @default true\n */\n dot?: boolean;\n};\n\n/** ----------------------------------------------------------------\n * * ***Pattern configuration wrapper.***\n * ----------------------------------------------------------------\n *\n * Provides an optional container for {@link PatternOptions | `PatternOptions`}.\n *\n * This wrapper allows pattern matching configuration to be composed\n * within higher-level configuration objects without flattening\n * the option namespace.\n *\n * ----------------------------------------------------------------\n *\n * @template FilesOnly\n * When `true`, directory-related options (`onlyFiles`, `onlyDirectories`)\n * are removed from the public configuration to enforce file-only matching.\n *\n * @template ForceUnique\n * When `true`, the `unique` option is removed from the underlying\n * {@link PatternOptions | `PatternOptions`} to guarantee deduplicated results.\n *\n * ----------------------------------------------------------------\n *\n * @example\n * ```ts\n * const config: PatternConfig = {\n * patternOptions: {\n * dot: true\n * }\n * };\n * ```\n */\nexport type PatternConfig<\n FilesOnly extends boolean = false,\n ForceUnique extends boolean = false\n> = Prettify<{\n /** ----------------------------------------------------------------\n * * ***Pattern matching options.***\n * ----------------------------------------------------------------\n *\n * Optional configuration for controlling file pattern resolution.\n *\n * When provided, these options are sanitized and merged with\n * the internal default configuration before being passed to\n * {@link fg | `fast-glob`}.\n *\n * @see {@link PatternOptions | `PatternOptions`} for supported fields.\n */\n patternOptions?: PatternOptions<FilesOnly, ForceUnique>;\n}>;\n\n/** ----------------------------------------------------------------\n * * ***Default pattern matching configuration.***\n * ----------------------------------------------------------------\n *\n * Represents the canonical baseline configuration used when\n * resolving pattern options.\n *\n * These values are applied whenever a user does not explicitly\n * provide overrides.\n *\n * This object also acts as the runtime source of truth for\n * allowed pattern option keys.\n */\nexport const defaultPatternOptions: PatternOptions = {\n absolute: false,\n baseNameMatch: false,\n caseSensitiveMatch: true,\n concurrency: os.cpus().length,\n dot: true,\n followSymbolicLinks: true,\n globstar: true,\n ignore: [],\n markDirectories: false,\n objectMode: false,\n onlyDirectories: false,\n onlyFiles: true,\n unique: true,\n throwErrorOnBrokenSymbolicLink: false\n};\n\n/** ----------------------------------------------------------------\n * * ***Determines whether a pattern option key is allowed.***\n * ----------------------------------------------------------------\n *\n * Evaluates whether a given {@link PatternOptions | `PatternOptions`}\n * key is permitted under the provided runtime policy.\n *\n * This function enforces restrictions such as:\n *\n * - Disallowing directory-related options when `filesOnly` is enabled.\n * - Preventing external control over the `unique` option when\n * `forceUnique` is enabled.\n *\n * ----------------------------------------------------------------\n *\n * @param key\n * A candidate {@link PatternOptions | `PatternOptions`} property key.\n *\n * @param policy\n * Optional runtime policy controlling which keys are allowed.\n *\n * @returns\n * `true` if the key is permitted under the current policy,\n * otherwise `false`.\n *\n * @internal\n */\nfunction isKeyAllowed(\n key: keyof PatternOptions,\n policy?: PatternRuntimePolicy<boolean, boolean>\n): boolean {\n if (!policy) return true;\n\n if (policy.filesOnly && (key === \"onlyFiles\" || key === \"onlyDirectories\"))\n return false;\n\n if (policy.forceUnique && key === \"unique\") return false;\n\n return true;\n}\n\n/** ----------------------------------------------------------------\n * * ***Runtime whitelist of allowed pattern option keys.***\n * ----------------------------------------------------------------\n *\n * Derived directly from {@link defaultPatternOptions | `defaultPatternOptions`}.\n *\n * This ensures strict synchronization between:\n *\n * - The static {@link PatternOptions | `PatternOptions`} type.\n * - Runtime validation logic used during option sanitization.\n *\n * By deriving the key list from the default configuration,\n * this module avoids manual duplication of allowed option names.\n *\n * ----------------------------------------------------------------\n *\n * This whitelist is used internally to:\n *\n * - Remove unknown properties from user-provided configuration.\n * - Guarantee that only supported options are passed to\n * {@link fg | `fast-glob`}.\n *\n * ----------------------------------------------------------------\n *\n * @internal\n */\nconst PATTERN_OPTION_KEYS = new Set<keyof PatternOptions>(\n Object.keys(defaultPatternOptions) as (keyof PatternOptions)[]\n);\n\n/** ----------------------------------------------------------------\n * * ***Assigns a validated pattern option property.***\n * ----------------------------------------------------------------\n *\n * Performs a type-safe assignment from a source object into a\n * partial {@link PatternOptions | `PatternOptions`} result object.\n *\n * A generic constraint is used to preserve proper indexed access\n * typing and avoid union assignment limitations in TypeScript.\n *\n * This helper assumes that:\n *\n * - The provided `key` has already been validated against\n * {@link PATTERN_OPTION_KEYS | `PATTERN_OPTION_KEYS`}.\n * - The property exists on the `source` object.\n *\n * ----------------------------------------------------------------\n *\n * @template K\n * A valid key of {@link PatternOptions | `PatternOptions`}.\n *\n * @param key\n * The validated pattern option key to assign.\n *\n * @param source\n * The original input object containing the property value.\n *\n * @param target\n * The partial result object receiving the assigned value.\n *\n * @internal\n */\nfunction assignIfAllowed<K extends keyof PatternOptions>(\n key: K,\n source: Record<string, unknown>,\n target: Partial<PatternOptions>\n) {\n target[key] = source[key] as PatternOptions[K];\n}\n\n/** ----------------------------------------------------------------\n * * ***Runtime policy controlling pattern option exposure.***\n * ----------------------------------------------------------------\n *\n * Defines runtime constraints that restrict which fields from\n * {@link PatternOptions | `PatternOptions`} are allowed to appear\n * in the final resolved configuration.\n *\n * This policy is primarily used by higher-level utilities that\n * enforce stricter behavior than the raw {@link fg | `fast-glob`} API.\n *\n * ----------------------------------------------------------------\n *\n * *Supported policies:*\n *\n * - `filesOnly`\n * Prevents directory-related configuration from being externally\n * controlled.\n *\n * - `forceUnique`\n * Ensures that uniqueness behavior is handled internally and\n * cannot be overridden by user configuration.\n *\n * ----------------------------------------------------------------\n *\n * These policies influence both:\n *\n * - Runtime sanitization of user-provided pattern options.\n * - Final resolution of merged configuration values.\n *\n * ----------------------------------------------------------------\n *\n * @template FilesOnly\n * Indicates whether directory-related options should be excluded.\n *\n * @template ForceUnique\n * Indicates whether the `unique` option should be excluded.\n */\nexport type PatternRuntimePolicy<\n FilesOnly extends boolean = boolean,\n ForceUnique extends boolean = boolean\n> = {\n /** ----------------------------------------------------------------\n * * ***Restricts directory-related pattern options.***\n * ----------------------------------------------------------------\n *\n * When enabled, directory filtering options are excluded from the\n * final configuration produced by the pattern resolution process.\n *\n * This prevents external configuration from modifying whether\n * directories or files are matched by the underlying\n * {@link fg | `fast-glob`} operation.\n *\n * ----------------------------------------------------------------\n *\n * *Affected options:*\n *\n * - `onlyFiles`\n * - `onlyDirectories`\n *\n * ----------------------------------------------------------------\n *\n * When `true`, these options are ignored during sanitization and\n * removed from the final resolved configuration.\n *\n * ----------------------------------------------------------------\n * @default false\n */\n filesOnly?: FilesOnly;\n\n /** ----------------------------------------------------------------\n * * ***Enforces internal uniqueness behavior.***\n * ----------------------------------------------------------------\n *\n * When enabled, the `unique` option is excluded from user-provided\n * configuration and controlled internally by the runtime.\n *\n * This ensures that result deduplication behavior cannot be\n * overridden by external configuration.\n *\n * ----------------------------------------------------------------\n *\n * *Affected option:*\n *\n * - `unique`\n *\n * ----------------------------------------------------------------\n *\n * When `true`, this option is ignored during sanitization and\n * removed from the final resolved configuration.\n *\n * ----------------------------------------------------------------\n * @default false\n */\n forceUnique?: ForceUnique;\n};\n\n/** ----------------------------------------------------------------\n * * ***Sanitizes pattern options by removing unknown keys.***\n * ----------------------------------------------------------------\n *\n * Ensures that the provided object only contains keys that exist in\n * {@link defaultPatternOptions | `defaultPatternOptions`}, any unknown keys will be removed.\n *\n * This function is intended for API boundary validation to prevent\n * unsafe or unexpected configuration injection.\n *\n * - *Behavior:*\n * - Ignores non-object values (returns empty object).\n * - Removes keys not present in {@link defaultPatternOptions | `defaultPatternOptions`}.\n * - Does NOT mutate the original object.\n *\n * ----------------------------------------------------------------\n *\n * @param input\n * The value to sanitize.\n *\n * @param policy\n * Optional runtime policy restricting which pattern options\n * are allowed during sanitization.\n *\n * @returns\n * A new object containing only allowed pattern option keys.\n *\n * @example\n * ```ts\n * const userOptions = {\n * absolute: true,\n * dot: true,\n * fakeKey: 123\n * };\n *\n * const clean = sanitizePatternOptions(userOptions);\n *\n * // Result:\n * // {\n * // absolute: true,\n * // dot: true\n * // }\n * ```\n */\nexport function sanitizePatternOptions(\n input: unknown,\n policy?: PatternRuntimePolicy<false, false>\n): Partial<PatternOptions<false, false>>;\nexport function sanitizePatternOptions(\n input: unknown,\n policy?: PatternRuntimePolicy<true, false>\n): Partial<PatternOptions<true, false>>;\nexport function sanitizePatternOptions(\n input: unknown,\n policy?: PatternRuntimePolicy<false, true>\n): Partial<PatternOptions<false, true>>;\nexport function sanitizePatternOptions(\n input: unknown,\n policy?: PatternRuntimePolicy<true, true>\n): Partial<PatternOptions<true, true>>;\nexport function sanitizePatternOptions(\n input: unknown,\n policy?: PatternRuntimePolicy<false, false>\n): Partial<PatternOptions<false, false>>;\nexport function sanitizePatternOptions(\n input: unknown,\n policy?: PatternRuntimePolicy<boolean, boolean>\n): Partial<PatternOptions>;\nexport function sanitizePatternOptions(\n input: unknown,\n policy?: PatternRuntimePolicy<boolean, boolean>\n): Partial<PatternOptions> {\n if (!isPlainObject(input)) return {};\n\n const source = input as Record<string, unknown>;\n const result: Partial<PatternOptions> = {};\n\n for (const key of Object.keys(source) as (keyof PatternOptions)[]) {\n if (PATTERN_OPTION_KEYS.has(key) && isKeyAllowed(key, policy)) {\n assignIfAllowed(key, source, result);\n }\n }\n\n return result;\n}\n\n/** ----------------------------------------------------------------\n * * ***Resolves pattern options with default values.***\n * ----------------------------------------------------------------\n *\n * Applies {@link sanitizePatternOptions | `sanitizePatternOptions`} to the provided input and merges\n * the result with `defaultPatternOptions`.\n *\n * - Unknown keys are removed.\n * - Missing keys fall back to defaults.\n *\n * Guarantees a fully-formed {@link PatternOptions | `PatternOptions`} object safe for direct\n * usage with `fast-glob`.\n *\n * ----------------------------------------------------------------\n *\n * @param input\n * Optional user-provided pattern options.\n *\n * @param policy\n * Optional runtime policy restricting which configuration\n * fields are allowed in the final resolved options.\n *\n * @returns\n * A complete and validated\n * {@link PatternOptions | `PatternOptions`} object ready for\n * direct usage with {@link fg | `fast-glob`}.\n *\n * @example\n * ```ts\n * const options = resolvePatternOptions({\n * dot: true,\n * fakeKey: 123\n * });\n *\n * // Result:\n * // {\n * // absolute: false,\n * // baseNameMatch: false,\n * // ...\n * // dot: true,\n * // ...\n * // }\n *\n * const matched = await fastGlobe(patterns, options);\n * ```\n */\nexport function resolvePatternOptions(\n input: unknown,\n policy?: PatternRuntimePolicy<false, false>\n): PatternOptions<false, false>;\nexport function resolvePatternOptions(\n input: unknown,\n policy?: PatternRuntimePolicy<true, false>\n): PatternOptions<true, false>;\nexport function resolvePatternOptions(\n input: unknown,\n policy?: PatternRuntimePolicy<false, true>\n): PatternOptions<false, true>;\nexport function resolvePatternOptions(\n input: unknown,\n policy?: PatternRuntimePolicy<true, true>\n): PatternOptions<true, true>;\nexport function resolvePatternOptions(\n input: unknown,\n policy?: PatternRuntimePolicy<false, false>\n): PatternOptions<false, false>;\nexport function resolvePatternOptions(\n input: unknown,\n policy?: PatternRuntimePolicy<boolean, boolean>\n): PatternOptions {\n const clean = sanitizePatternOptions(input, policy);\n\n const options: PatternOptions = {\n ...defaultPatternOptions,\n ...clean\n };\n\n if (policy?.filesOnly) {\n delete options.onlyFiles;\n delete options.onlyDirectories;\n }\n\n if (policy?.forceUnique) {\n delete options.unique;\n }\n\n return options;\n}\n\n/** ----------------------------------------------------------------\n * * ***Stable structural equality detector.***\n * ----------------------------------------------------------------\n *\n * Determines whether two values are structurally identical using\n * deterministic serialization via `safeStableStringify`.\n *\n * - *This comparison:*\n * - Preserves `undefined` values.\n * - Sorts object keys.\n * - Sorts arrays (optional structural normalization).\n *\n * - *Ensures stable equality checks for configuration objects where:*\n * - Property order may differ.\n * - Object references are not identical.\n * - Deep comparison is required.\n *\n * ----------------------------------------------------------------\n *\n * @template T - Value type being compared.\n *\n * @param value - The current runtime value.\n * @param defaultValue - The default reference value.\n *\n * @returns\n * - `\"default\"` ➔ If values are structurally identical.\n * - `\"overridden\"` ➔ If values differ.\n *\n * @example\n * ```ts\n * const source = sourceOfPatternOptions(\n * cleanPatternOptions,\n * defaultPatternOptions\n * );\n *\n * // ➔ \"default\" | \"overridden\"\n * ```\n *\n * @internal\n */\nexport function sourceOfPatternOptions<T>(\n value: T,\n defaultValue: T\n): \"default\" | \"overridden\" {\n const stableStringifyOptions = {\n keepUndefined: true,\n sortArray: true,\n sortKeys: true\n } satisfies SafeStableStringifyOptions;\n\n const a = safeStableStringify(value, stableStringifyOptions);\n\n const b = safeStableStringify(defaultValue, stableStringifyOptions);\n\n return a === b ? \"default\" : \"overridden\";\n}\n","import \"@rzl-zone/node-only\";\n\nimport \"dotenv/config\";\n\n// eslint-disable-next-line turbo/no-undeclared-env-vars\nconst USE_EMOJI = process.env.FORCE_EMOJI === \"1\";\n\ntype Icons = {\n readonly [K in keyof typeof emojiIcons]: string;\n};\n\nconst emojiIcons = {\n /* flow */\n start: \"🕐\",\n arrowRight: \"▶️\",\n arrowRightMini: \"›\",\n\n /* list */\n bulletBold: \"●\",\n bullet: \"•\",\n whiteCircle: \"○\",\n whiteBullet: \"◦\",\n smallSquare: \"▪\",\n\n /* status */\n success: \"✅\",\n warn: \"⚠️\",\n error: \"❌\",\n\n /* config */\n config: \"⚙️\",\n settings: \"🛠️\",\n\n /* files & fs */\n file: \"📄\",\n files: \"📁\",\n folder: \"📂\",\n path: \"🧭\",\n\n /* actions */\n add: \"➕\",\n remove: \"➖\",\n update: \"♻️\",\n copy: \"📋\",\n move: \"📦\",\n clean: \"🧹\",\n\n /* build / process */\n build: \"🏗️\",\n generate: \"🧩\",\n compile: \"⚡\",\n watch: \"👀\",\n\n /* info / misc */\n info: \"ℹ️\",\n debug: \"🐛\",\n question: \"❓\",\n separator: \"━\"\n} as const;\n\nconst asciiIcons = {\n /* flow */\n start: \"▶\",\n arrowRight: \"▶\",\n arrowRightMini: \"›\",\n\n /* list */\n bulletBold: \"●\",\n bullet: \"•\",\n whiteCircle: \"○\",\n whiteBullet: \"◦\",\n smallSquare: \"▪\",\n\n /* status */\n success: \"✅\",\n warn: \"⚠️ \",\n error: \"❌\",\n\n /* config */\n config: \"#\",\n settings: \"@\",\n\n /* files & fs */\n file: \"F\",\n files: \"DIR\",\n folder: \"DIR\",\n path: \"~\",\n\n /* actions */\n add: \"+\",\n remove: \"-\",\n update: \"~\",\n copy: \"=\",\n move: \">\",\n clean: \"x\",\n\n /* build / process */\n build: \"#\",\n generate: \"*\",\n compile: \">\",\n watch: \"o\",\n\n /* info / misc */\n info: \"i\",\n debug: \"d\",\n question: \"?\",\n separator: \"-\"\n} as const satisfies Icons;\n\n/** ----------------------------------------------------------------\n * * ***CLI icon mapping (emoji or ASCII fallback).***\n * ----------------------------------------------------------------\n *\n * Provides a centralized set of visual symbols used across the CLI\n * for rendering flow indicators, status messages, filesystem labels,\n * and action markers.\n *\n * - *The icon set is determined at runtime via the environment variable:*\n * - `FORCE_EMOJI=1` ➜ Emoji icons are enabled.\n * - Otherwise ➜ ASCII-safe fallback icons are used.\n *\n * - *This ensures compatibility with:*\n * - Terminals that do not support emoji rendering.\n * - CI environments.\n * - Minimal shells or log files.\n * - *Behavior:*\n * - The object shape is identical in both modes.\n * - Only the visual representation changes.\n * - The value is resolved once at module evaluation time.\n * ----------------------------------------------------------------\n * #### Environment Control\n * ```bash\n * FORCE_EMOJI=1\n * ```\n * ----------------------------------------------------------------\n * @remarks\n * This constant is intended for internal CLI rendering only, do not mutate the returned object.\n *\n * @example\n * ```ts\n * console.log(`${ICONS.success} Build completed`);\n * ```\n *\n */\nexport const ICONS: Readonly<Icons> = Object.freeze(\n USE_EMOJI ? emojiIcons : asciiIcons\n);\n","import \"@rzl-zone/node-only\";\n\nimport _fsExtra from \"fs-extra\";\nimport _fastGlob from \"fast-glob\";\n\nexport { ICONS } from \"@/utils/helper/icons\";\n\n/** ----------------------------------------------------------------\n * * ***Node.js–only filesystem utilities (fs-extra).***\n * ----------------------------------------------------------------\n *\n * This export is a **thin re-export** of the `fs-extra` package,\n * intended for **server-side / Node.js environments only**.\n *\n * ⚠️ **DO NOT import this in browser or client-side code.**\n * The underlying implementation depends on Node.js built-in\n * modules such as `fs`, `path`, and `process`.\n *\n * - *Typical use cases:*\n * - CLI tools.\n * - Build scripts.\n * - File system manipulation on the server.\n *\n * @see {@link https://github.com/jprichardson/node-fs-extra | **`https://github.com/jprichardson/node-fs-extra`**}.\n * @environment node\n */\nexport const fsExtra: typeof _fsExtra = _fsExtra;\n\n/** ----------------------------------------------------------------\n * * ***High-performance file system globbing utility (fast-glob).***\n * ----------------------------------------------------------------\n *\n * This export re-exports the default export of `fast-glob`,\n * which is implemented using **CommonJS `export =` semantics**.\n *\n * Due to its reliance on Node.js APIs, this module is\n * **server-side only** and must not be bundled for the browser.\n *\n * - *Typical use cases:*\n * - Resolving file patterns in build tools.\n * - Scanning project directories.\n * - CLI and automation scripts.\n *\n * @see {@link https://github.com/mrmlnc/fast-glob | **`https://github.com/mrmlnc/fast-glob`**}.\n * @environment node\n */\nexport const fastGlob: typeof _fastGlob = _fastGlob;\n\nexport {\n defaultPatternOptions,\n type PatternConfig,\n type PatternOptions\n} from \"@/_internal/libs/fast-globe-options\";\n"],"mappings":"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"}
1
+ {"version":3,"file":"server-BA7ruG1h.js","names":[],"sources":["../src/_internal/libs/fast-globe-options.ts","../src/utils/helper/icons.ts","../src/utils/server.ts"],"sourcesContent":["import \"@rzl-zone/node-only\";\n\nimport type { OmitStrict, Prettify } from \"../types/extra\";\n\nimport os from \"node:os\";\nimport * as fg from \"fast-glob\";\n\nimport {\n isPlainObject,\n safeStableStringify,\n type SafeStableStringifyOptions\n} from \"@/_internal/utils/helper\";\n\ntype IfTrueGeneric<T extends boolean, K> = T extends true ? K : never;\n\n/** ----------------------------------------------------------------\n * * ***Supported pattern matching options.***\n * ----------------------------------------------------------------\n * Defines the subset of {@link fg | `fast-glob`} options exposed by\n * this module for pattern-based file resolution.\n *\n * This type intentionally omits several low-level or environment-\n * controlled fields to ensure predictable and safe behavior.\n *\n * ----------------------------------------------------------------\n *\n * *Excluded options (managed internally):*\n *\n * - `fs`\n * - `cwd`\n * - `stats`\n * - `deep`\n * - `extglob`\n * - `suppressErrors`\n * - `braceExpansion`\n *\n * These fields are controlled by the runtime environment and should\n * not be overridden by consumers.\n *\n * ----------------------------------------------------------------\n * @template FilesOnly\n * When `true`, directory filtering options (`onlyFiles`, `onlyDirectories`)\n * are removed from the public API surface, preventing consumers from\n * modifying directory matching behavior.\n *\n * @template ForceUnique\n * When `true`, the `unique` option is removed from the public API to enforce internal uniqueness handling.\n *\n * This allows higher-level utilities to guarantee that matched results\n * are always deduplicated.\n *\n * ----------------------------------------------------------------\n *\n * This type serves as the public configuration contract used when\n * resolving glob patterns.\n */\nexport type PatternOptions<\n FilesOnly extends boolean = false,\n ForceUnique extends boolean = false\n> = OmitStrict<\n fg.Options,\n | \"fs\"\n | \"cwd\"\n | \"stats\"\n | \"deep\"\n | \"extglob\"\n | \"suppressErrors\"\n | \"braceExpansion\"\n | \"dot\"\n | IfTrueGeneric<FilesOnly, \"onlyFiles\" | \"onlyDirectories\">\n | IfTrueGeneric<ForceUnique, \"unique\">,\n { skipPrettify: true }\n> & {\n /** Allow patterns to match entries that begin with a period (`.`).\n *\n * @default true\n */\n dot?: boolean;\n};\n\n/** ----------------------------------------------------------------\n * * ***Pattern configuration wrapper.***\n * ----------------------------------------------------------------\n *\n * Provides an optional container for {@link PatternOptions | `PatternOptions`}.\n *\n * This wrapper allows pattern matching configuration to be composed\n * within higher-level configuration objects without flattening\n * the option namespace.\n *\n * ----------------------------------------------------------------\n *\n * @template FilesOnly\n * When `true`, directory-related options (`onlyFiles`, `onlyDirectories`)\n * are removed from the public configuration to enforce file-only matching.\n *\n * @template ForceUnique\n * When `true`, the `unique` option is removed from the underlying\n * {@link PatternOptions | `PatternOptions`} to guarantee deduplicated results.\n *\n * ----------------------------------------------------------------\n *\n * @example\n * ```ts\n * const config: PatternConfig = {\n * patternOptions: {\n * dot: true\n * }\n * };\n * ```\n */\nexport type PatternConfig<\n FilesOnly extends boolean = false,\n ForceUnique extends boolean = false\n> = Prettify<{\n /** ----------------------------------------------------------------\n * * ***Pattern matching options.***\n * ----------------------------------------------------------------\n *\n * Optional configuration for controlling file pattern resolution.\n *\n * When provided, these options are sanitized and merged with\n * the internal default configuration before being passed to\n * {@link fg | `fast-glob`}.\n *\n * @see {@link PatternOptions | `PatternOptions`} for supported fields.\n */\n patternOptions?: PatternOptions<FilesOnly, ForceUnique>;\n}>;\n\n/** ----------------------------------------------------------------\n * * ***Default pattern matching configuration.***\n * ----------------------------------------------------------------\n *\n * Represents the canonical baseline configuration used when\n * resolving pattern options.\n *\n * These values are applied whenever a user does not explicitly\n * provide overrides.\n *\n * This object also acts as the runtime source of truth for\n * allowed pattern option keys.\n */\nexport const defaultPatternOptions: PatternOptions = {\n absolute: false,\n baseNameMatch: false,\n caseSensitiveMatch: true,\n concurrency: os.cpus().length,\n dot: true,\n followSymbolicLinks: true,\n globstar: true,\n ignore: [],\n markDirectories: false,\n objectMode: false,\n onlyDirectories: false,\n onlyFiles: true,\n unique: true,\n throwErrorOnBrokenSymbolicLink: false\n};\n\n/** ----------------------------------------------------------------\n * * ***Determines whether a pattern option key is allowed.***\n * ----------------------------------------------------------------\n *\n * Evaluates whether a given {@link PatternOptions | `PatternOptions`}\n * key is permitted under the provided runtime policy.\n *\n * This function enforces restrictions such as:\n *\n * - Disallowing directory-related options when `filesOnly` is enabled.\n * - Preventing external control over the `unique` option when\n * `forceUnique` is enabled.\n *\n * ----------------------------------------------------------------\n *\n * @param key\n * A candidate {@link PatternOptions | `PatternOptions`} property key.\n *\n * @param policy\n * Optional runtime policy controlling which keys are allowed.\n *\n * @returns\n * `true` if the key is permitted under the current policy,\n * otherwise `false`.\n *\n * @internal\n */\nfunction isKeyAllowed(\n key: keyof PatternOptions,\n policy?: PatternRuntimePolicy<boolean, boolean>\n): boolean {\n if (!policy) return true;\n\n if (policy.filesOnly && (key === \"onlyFiles\" || key === \"onlyDirectories\"))\n return false;\n\n if (policy.forceUnique && key === \"unique\") return false;\n\n return true;\n}\n\n/** ----------------------------------------------------------------\n * * ***Runtime whitelist of allowed pattern option keys.***\n * ----------------------------------------------------------------\n *\n * Derived directly from {@link defaultPatternOptions | `defaultPatternOptions`}.\n *\n * This ensures strict synchronization between:\n *\n * - The static {@link PatternOptions | `PatternOptions`} type.\n * - Runtime validation logic used during option sanitization.\n *\n * By deriving the key list from the default configuration,\n * this module avoids manual duplication of allowed option names.\n *\n * ----------------------------------------------------------------\n *\n * This whitelist is used internally to:\n *\n * - Remove unknown properties from user-provided configuration.\n * - Guarantee that only supported options are passed to\n * {@link fg | `fast-glob`}.\n *\n * ----------------------------------------------------------------\n *\n * @internal\n */\nconst PATTERN_OPTION_KEYS = new Set<keyof PatternOptions>(\n Object.keys(defaultPatternOptions) as (keyof PatternOptions)[]\n);\n\n/** ----------------------------------------------------------------\n * * ***Assigns a validated pattern option property.***\n * ----------------------------------------------------------------\n *\n * Performs a type-safe assignment from a source object into a\n * partial {@link PatternOptions | `PatternOptions`} result object.\n *\n * A generic constraint is used to preserve proper indexed access\n * typing and avoid union assignment limitations in TypeScript.\n *\n * This helper assumes that:\n *\n * - The provided `key` has already been validated against\n * {@link PATTERN_OPTION_KEYS | `PATTERN_OPTION_KEYS`}.\n * - The property exists on the `source` object.\n *\n * ----------------------------------------------------------------\n *\n * @template K\n * A valid key of {@link PatternOptions | `PatternOptions`}.\n *\n * @param key\n * The validated pattern option key to assign.\n *\n * @param source\n * The original input object containing the property value.\n *\n * @param target\n * The partial result object receiving the assigned value.\n *\n * @internal\n */\nfunction assignIfAllowed<K extends keyof PatternOptions>(\n key: K,\n source: Record<string, unknown>,\n target: Partial<PatternOptions>\n) {\n target[key] = source[key] as PatternOptions[K];\n}\n\n/** ----------------------------------------------------------------\n * * ***Runtime policy controlling pattern option exposure.***\n * ----------------------------------------------------------------\n *\n * Defines runtime constraints that restrict which fields from\n * {@link PatternOptions | `PatternOptions`} are allowed to appear\n * in the final resolved configuration.\n *\n * This policy is primarily used by higher-level utilities that\n * enforce stricter behavior than the raw {@link fg | `fast-glob`} API.\n *\n * ----------------------------------------------------------------\n *\n * *Supported policies:*\n *\n * - `filesOnly`\n * Prevents directory-related configuration from being externally\n * controlled.\n *\n * - `forceUnique`\n * Ensures that uniqueness behavior is handled internally and\n * cannot be overridden by user configuration.\n *\n * ----------------------------------------------------------------\n *\n * These policies influence both:\n *\n * - Runtime sanitization of user-provided pattern options.\n * - Final resolution of merged configuration values.\n *\n * ----------------------------------------------------------------\n *\n * @template FilesOnly\n * Indicates whether directory-related options should be excluded.\n *\n * @template ForceUnique\n * Indicates whether the `unique` option should be excluded.\n */\nexport type PatternRuntimePolicy<\n FilesOnly extends boolean = boolean,\n ForceUnique extends boolean = boolean\n> = {\n /** ----------------------------------------------------------------\n * * ***Restricts directory-related pattern options.***\n * ----------------------------------------------------------------\n *\n * When enabled, directory filtering options are excluded from the\n * final configuration produced by the pattern resolution process.\n *\n * This prevents external configuration from modifying whether\n * directories or files are matched by the underlying\n * {@link fg | `fast-glob`} operation.\n *\n * ----------------------------------------------------------------\n *\n * *Affected options:*\n *\n * - `onlyFiles`\n * - `onlyDirectories`\n *\n * ----------------------------------------------------------------\n *\n * When `true`, these options are ignored during sanitization and\n * removed from the final resolved configuration.\n *\n * ----------------------------------------------------------------\n * @default false\n */\n filesOnly?: FilesOnly;\n\n /** ----------------------------------------------------------------\n * * ***Enforces internal uniqueness behavior.***\n * ----------------------------------------------------------------\n *\n * When enabled, the `unique` option is excluded from user-provided\n * configuration and controlled internally by the runtime.\n *\n * This ensures that result deduplication behavior cannot be\n * overridden by external configuration.\n *\n * ----------------------------------------------------------------\n *\n * *Affected option:*\n *\n * - `unique`\n *\n * ----------------------------------------------------------------\n *\n * When `true`, this option is ignored during sanitization and\n * removed from the final resolved configuration.\n *\n * ----------------------------------------------------------------\n * @default false\n */\n forceUnique?: ForceUnique;\n};\n\n/** ----------------------------------------------------------------\n * * ***Sanitizes pattern options by removing unknown keys.***\n * ----------------------------------------------------------------\n *\n * Ensures that the provided object only contains keys that exist in\n * {@link defaultPatternOptions | `defaultPatternOptions`}, any unknown keys will be removed.\n *\n * This function is intended for API boundary validation to prevent\n * unsafe or unexpected configuration injection.\n *\n * - *Behavior:*\n * - Ignores non-object values (returns empty object).\n * - Removes keys not present in {@link defaultPatternOptions | `defaultPatternOptions`}.\n * - Does NOT mutate the original object.\n *\n * ----------------------------------------------------------------\n *\n * @param input\n * The value to sanitize.\n *\n * @param policy\n * Optional runtime policy restricting which pattern options\n * are allowed during sanitization.\n *\n * @returns\n * A new object containing only allowed pattern option keys.\n *\n * @example\n * ```ts\n * const userOptions = {\n * absolute: true,\n * dot: true,\n * fakeKey: 123\n * };\n *\n * const clean = sanitizePatternOptions(userOptions);\n *\n * // Result:\n * // {\n * // absolute: true,\n * // dot: true\n * // }\n * ```\n */\nexport function sanitizePatternOptions(\n input: unknown,\n policy?: PatternRuntimePolicy<false, false>\n): Partial<PatternOptions<false, false>>;\nexport function sanitizePatternOptions(\n input: unknown,\n policy?: PatternRuntimePolicy<true, false>\n): Partial<PatternOptions<true, false>>;\nexport function sanitizePatternOptions(\n input: unknown,\n policy?: PatternRuntimePolicy<false, true>\n): Partial<PatternOptions<false, true>>;\nexport function sanitizePatternOptions(\n input: unknown,\n policy?: PatternRuntimePolicy<true, true>\n): Partial<PatternOptions<true, true>>;\nexport function sanitizePatternOptions(\n input: unknown,\n policy?: PatternRuntimePolicy<false, false>\n): Partial<PatternOptions<false, false>>;\nexport function sanitizePatternOptions(\n input: unknown,\n policy?: PatternRuntimePolicy<boolean, boolean>\n): Partial<PatternOptions>;\nexport function sanitizePatternOptions(\n input: unknown,\n policy?: PatternRuntimePolicy<boolean, boolean>\n): Partial<PatternOptions> {\n if (!isPlainObject(input)) return {};\n\n const source = input as Record<string, unknown>;\n const result: Partial<PatternOptions> = {};\n\n for (const key of Object.keys(source) as (keyof PatternOptions)[]) {\n if (PATTERN_OPTION_KEYS.has(key) && isKeyAllowed(key, policy)) {\n assignIfAllowed(key, source, result);\n }\n }\n\n return result;\n}\n\n/** ----------------------------------------------------------------\n * * ***Resolves pattern options with default values.***\n * ----------------------------------------------------------------\n *\n * Applies {@link sanitizePatternOptions | `sanitizePatternOptions`} to the provided input and merges\n * the result with `defaultPatternOptions`.\n *\n * - Unknown keys are removed.\n * - Missing keys fall back to defaults.\n *\n * Guarantees a fully-formed {@link PatternOptions | `PatternOptions`} object safe for direct\n * usage with `fast-glob`.\n *\n * ----------------------------------------------------------------\n *\n * @param input\n * Optional user-provided pattern options.\n *\n * @param policy\n * Optional runtime policy restricting which configuration\n * fields are allowed in the final resolved options.\n *\n * @returns\n * A complete and validated\n * {@link PatternOptions | `PatternOptions`} object ready for\n * direct usage with {@link fg | `fast-glob`}.\n *\n * @example\n * ```ts\n * const options = resolvePatternOptions({\n * dot: true,\n * fakeKey: 123\n * });\n *\n * // Result:\n * // {\n * // absolute: false,\n * // baseNameMatch: false,\n * // ...\n * // dot: true,\n * // ...\n * // }\n *\n * const matched = await fastGlobe(patterns, options);\n * ```\n */\nexport function resolvePatternOptions(\n input: unknown,\n policy?: PatternRuntimePolicy<false, false>\n): PatternOptions<false, false>;\nexport function resolvePatternOptions(\n input: unknown,\n policy?: PatternRuntimePolicy<true, false>\n): PatternOptions<true, false>;\nexport function resolvePatternOptions(\n input: unknown,\n policy?: PatternRuntimePolicy<false, true>\n): PatternOptions<false, true>;\nexport function resolvePatternOptions(\n input: unknown,\n policy?: PatternRuntimePolicy<true, true>\n): PatternOptions<true, true>;\nexport function resolvePatternOptions(\n input: unknown,\n policy?: PatternRuntimePolicy<false, false>\n): PatternOptions<false, false>;\nexport function resolvePatternOptions(\n input: unknown,\n policy?: PatternRuntimePolicy<boolean, boolean>\n): PatternOptions {\n const clean = sanitizePatternOptions(input, policy);\n\n const options: PatternOptions = {\n ...defaultPatternOptions,\n ...clean\n };\n\n if (policy?.filesOnly) {\n delete options.onlyFiles;\n delete options.onlyDirectories;\n }\n\n if (policy?.forceUnique) {\n delete options.unique;\n }\n\n return options;\n}\n\n/** ----------------------------------------------------------------\n * * ***Stable structural equality detector.***\n * ----------------------------------------------------------------\n *\n * Determines whether two values are structurally identical using\n * deterministic serialization via `safeStableStringify`.\n *\n * - *This comparison:*\n * - Preserves `undefined` values.\n * - Sorts object keys.\n * - Sorts arrays (optional structural normalization).\n *\n * - *Ensures stable equality checks for configuration objects where:*\n * - Property order may differ.\n * - Object references are not identical.\n * - Deep comparison is required.\n *\n * ----------------------------------------------------------------\n *\n * @template T - Value type being compared.\n *\n * @param value - The current runtime value.\n * @param defaultValue - The default reference value.\n *\n * @returns\n * - `\"default\"` ➔ If values are structurally identical.\n * - `\"overridden\"` ➔ If values differ.\n *\n * @example\n * ```ts\n * const source = sourceOfPatternOptions(\n * cleanPatternOptions,\n * defaultPatternOptions\n * );\n *\n * // ➔ \"default\" | \"overridden\"\n * ```\n *\n * @internal\n */\nexport function sourceOfPatternOptions<T>(\n value: T,\n defaultValue: T\n): \"default\" | \"overridden\" {\n const stableStringifyOptions = {\n keepUndefined: true,\n sortArray: true,\n sortKeys: true\n } satisfies SafeStableStringifyOptions;\n\n const a = safeStableStringify(value, stableStringifyOptions);\n\n const b = safeStableStringify(defaultValue, stableStringifyOptions);\n\n return a === b ? \"default\" : \"overridden\";\n}\n","import \"@rzl-zone/node-only\";\n\nimport \"dotenv/config\";\n\n// eslint-disable-next-line turbo/no-undeclared-env-vars\nconst USE_EMOJI = process.env.FORCE_EMOJI === \"1\";\n\ntype Icons = {\n readonly [K in keyof typeof emojiIcons]: string;\n};\n\nconst emojiIcons = {\n /* flow */\n start: \"🕐\",\n arrowRight: \"▶️\",\n arrowRightMini: \"›\",\n\n /* list */\n bulletBold: \"●\",\n bullet: \"•\",\n whiteCircle: \"○\",\n whiteBullet: \"◦\",\n smallSquare: \"▪\",\n\n /* status */\n success: \"✅\",\n warn: \"⚠️\",\n error: \"❌\",\n\n /* config */\n config: \"⚙️\",\n settings: \"🛠️\",\n\n /* files & fs */\n file: \"📄\",\n files: \"📁\",\n folder: \"📂\",\n path: \"🧭\",\n\n /* actions */\n add: \"➕\",\n remove: \"➖\",\n update: \"♻️\",\n copy: \"📋\",\n move: \"📦\",\n clean: \"🧹\",\n\n /* build / process */\n build: \"🏗️\",\n generate: \"🧩\",\n compile: \"⚡\",\n watch: \"👀\",\n\n /* info / misc */\n info: \"ℹ️\",\n debug: \"🐛\",\n question: \"❓\",\n separator: \"━\"\n} as const;\n\nconst asciiIcons = {\n /* flow */\n start: \"▶\",\n arrowRight: \"▶\",\n arrowRightMini: \"›\",\n\n /* list */\n bulletBold: \"●\",\n bullet: \"•\",\n whiteCircle: \"○\",\n whiteBullet: \"◦\",\n smallSquare: \"▪\",\n\n /* status */\n success: \"✅\",\n warn: \"⚠️ \",\n error: \"❌\",\n\n /* config */\n config: \"#\",\n settings: \"@\",\n\n /* files & fs */\n file: \"F\",\n files: \"DIR\",\n folder: \"DIR\",\n path: \"~\",\n\n /* actions */\n add: \"+\",\n remove: \"-\",\n update: \"~\",\n copy: \"=\",\n move: \">\",\n clean: \"x\",\n\n /* build / process */\n build: \"#\",\n generate: \"*\",\n compile: \">\",\n watch: \"o\",\n\n /* info / misc */\n info: \"i\",\n debug: \"d\",\n question: \"?\",\n separator: \"-\"\n} as const satisfies Icons;\n\n/** ----------------------------------------------------------------\n * * ***CLI icon mapping (emoji or ASCII fallback).***\n * ----------------------------------------------------------------\n *\n * Provides a centralized set of visual symbols used across the CLI\n * for rendering flow indicators, status messages, filesystem labels,\n * and action markers.\n *\n * - *The icon set is determined at runtime via the environment variable:*\n * - `FORCE_EMOJI=1` ➜ Emoji icons are enabled.\n * - Otherwise ➜ ASCII-safe fallback icons are used.\n *\n * - *This ensures compatibility with:*\n * - Terminals that do not support emoji rendering.\n * - CI environments.\n * - Minimal shells or log files.\n * - *Behavior:*\n * - The object shape is identical in both modes.\n * - Only the visual representation changes.\n * - The value is resolved once at module evaluation time.\n * ----------------------------------------------------------------\n * #### Environment Control\n * ```bash\n * FORCE_EMOJI=1\n * ```\n * ----------------------------------------------------------------\n * @remarks\n * This constant is intended for internal CLI rendering only, do not mutate the returned object.\n *\n * @example\n * ```ts\n * console.log(`${ICONS.success} Build completed`);\n * ```\n *\n */\nexport const ICONS: Readonly<Icons> = Object.freeze(\n USE_EMOJI ? emojiIcons : asciiIcons\n);\n","import \"@rzl-zone/node-only\";\n\nimport _fsExtra from \"fs-extra\";\nimport _fastGlob from \"fast-glob\";\n\nexport { ICONS } from \"@/utils/helper/icons\";\n\n/** ----------------------------------------------------------------\n * * ***Node.js–only filesystem utilities (fs-extra).***\n * ----------------------------------------------------------------\n *\n * This export is a **thin re-export** of the `fs-extra` package,\n * intended for **server-side / Node.js environments only**.\n *\n * ⚠️ **DO NOT import this in browser or client-side code.**\n * The underlying implementation depends on Node.js built-in\n * modules such as `fs`, `path`, and `process`.\n *\n * - *Typical use cases:*\n * - CLI tools.\n * - Build scripts.\n * - File system manipulation on the server.\n *\n * @see {@link https://github.com/jprichardson/node-fs-extra | **`https://github.com/jprichardson/node-fs-extra`**}.\n * @environment node\n */\nexport const fsExtra: typeof _fsExtra = _fsExtra;\n\n/** ----------------------------------------------------------------\n * * ***High-performance file system globbing utility (fast-glob).***\n * ----------------------------------------------------------------\n *\n * This export re-exports the default export of `fast-glob`,\n * which is implemented using **CommonJS `export =` semantics**.\n *\n * Due to its reliance on Node.js APIs, this module is\n * **server-side only** and must not be bundled for the browser.\n *\n * - *Typical use cases:*\n * - Resolving file patterns in build tools.\n * - Scanning project directories.\n * - CLI and automation scripts.\n *\n * @see {@link https://github.com/mrmlnc/fast-glob | **`https://github.com/mrmlnc/fast-glob`**}.\n * @environment node\n */\nexport const fastGlob: typeof _fastGlob = _fastGlob;\n\nexport {\n defaultPatternOptions,\n type PatternConfig,\n type PatternOptions\n} from \"@/_internal/libs/fast-globe-options\";\n"],"mappings":"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"}
@@ -2,14 +2,14 @@
2
2
  * ========================================================================
3
3
  * @rzl-zone/build-tools
4
4
  * ------------------------------------------------------------------------
5
- * Version: `0.0.9`
5
+ * Version: `0.0.10`
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
11
  "use strict";
12
- const require_helper = require('./helper-DpeqwciR.cjs');
12
+ const require_helper = require('./helper-DvCvgDxy.cjs');
13
13
  require("@rzl-zone/node-only");
14
14
  let node_os = require("node:os");
15
15
  node_os = require_helper.__toESM(node_os, 1);
@@ -178,4 +178,4 @@ Object.defineProperty(exports, 'sourceOfPatternOptions', {
178
178
  return sourceOfPatternOptions;
179
179
  }
180
180
  });
181
- //# sourceMappingURL=server-BK6eykjo.cjs.map
181
+ //# sourceMappingURL=server-DZvrqlyy.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"server-BK6eykjo.cjs","names":["os","isPlainObject","safeStableStringify","_fsExtra","_fastGlob"],"sources":["../src/_internal/libs/fast-globe-options.ts","../src/utils/helper/icons.ts","../src/utils/server.ts"],"sourcesContent":["import \"@rzl-zone/node-only\";\n\nimport type { OmitStrict, Prettify } from \"../types/extra\";\n\nimport os from \"node:os\";\nimport * as fg from \"fast-glob\";\n\nimport {\n isPlainObject,\n safeStableStringify,\n type SafeStableStringifyOptions\n} from \"@/_internal/utils/helper\";\n\ntype IfTrueGeneric<T extends boolean, K> = T extends true ? K : never;\n\n/** ----------------------------------------------------------------\n * * ***Supported pattern matching options.***\n * ----------------------------------------------------------------\n * Defines the subset of {@link fg | `fast-glob`} options exposed by\n * this module for pattern-based file resolution.\n *\n * This type intentionally omits several low-level or environment-\n * controlled fields to ensure predictable and safe behavior.\n *\n * ----------------------------------------------------------------\n *\n * *Excluded options (managed internally):*\n *\n * - `fs`\n * - `cwd`\n * - `stats`\n * - `deep`\n * - `extglob`\n * - `suppressErrors`\n * - `braceExpansion`\n *\n * These fields are controlled by the runtime environment and should\n * not be overridden by consumers.\n *\n * ----------------------------------------------------------------\n * @template FilesOnly\n * When `true`, directory filtering options (`onlyFiles`, `onlyDirectories`)\n * are removed from the public API surface, preventing consumers from\n * modifying directory matching behavior.\n *\n * @template ForceUnique\n * When `true`, the `unique` option is removed from the public API to enforce internal uniqueness handling.\n *\n * This allows higher-level utilities to guarantee that matched results\n * are always deduplicated.\n *\n * ----------------------------------------------------------------\n *\n * This type serves as the public configuration contract used when\n * resolving glob patterns.\n */\nexport type PatternOptions<\n FilesOnly extends boolean = false,\n ForceUnique extends boolean = false\n> = OmitStrict<\n fg.Options,\n | \"fs\"\n | \"cwd\"\n | \"stats\"\n | \"deep\"\n | \"extglob\"\n | \"suppressErrors\"\n | \"braceExpansion\"\n | \"dot\"\n | IfTrueGeneric<FilesOnly, \"onlyFiles\" | \"onlyDirectories\">\n | IfTrueGeneric<ForceUnique, \"unique\">,\n { skipPrettify: true }\n> & {\n /** Allow patterns to match entries that begin with a period (`.`).\n *\n * @default true\n */\n dot?: boolean;\n};\n\n/** ----------------------------------------------------------------\n * * ***Pattern configuration wrapper.***\n * ----------------------------------------------------------------\n *\n * Provides an optional container for {@link PatternOptions | `PatternOptions`}.\n *\n * This wrapper allows pattern matching configuration to be composed\n * within higher-level configuration objects without flattening\n * the option namespace.\n *\n * ----------------------------------------------------------------\n *\n * @template FilesOnly\n * When `true`, directory-related options (`onlyFiles`, `onlyDirectories`)\n * are removed from the public configuration to enforce file-only matching.\n *\n * @template ForceUnique\n * When `true`, the `unique` option is removed from the underlying\n * {@link PatternOptions | `PatternOptions`} to guarantee deduplicated results.\n *\n * ----------------------------------------------------------------\n *\n * @example\n * ```ts\n * const config: PatternConfig = {\n * patternOptions: {\n * dot: true\n * }\n * };\n * ```\n */\nexport type PatternConfig<\n FilesOnly extends boolean = false,\n ForceUnique extends boolean = false\n> = Prettify<{\n /** ----------------------------------------------------------------\n * * ***Pattern matching options.***\n * ----------------------------------------------------------------\n *\n * Optional configuration for controlling file pattern resolution.\n *\n * When provided, these options are sanitized and merged with\n * the internal default configuration before being passed to\n * {@link fg | `fast-glob`}.\n *\n * @see {@link PatternOptions | `PatternOptions`} for supported fields.\n */\n patternOptions?: PatternOptions<FilesOnly, ForceUnique>;\n}>;\n\n/** ----------------------------------------------------------------\n * * ***Default pattern matching configuration.***\n * ----------------------------------------------------------------\n *\n * Represents the canonical baseline configuration used when\n * resolving pattern options.\n *\n * These values are applied whenever a user does not explicitly\n * provide overrides.\n *\n * This object also acts as the runtime source of truth for\n * allowed pattern option keys.\n */\nexport const defaultPatternOptions: PatternOptions = {\n absolute: false,\n baseNameMatch: false,\n caseSensitiveMatch: true,\n concurrency: os.cpus().length,\n dot: true,\n followSymbolicLinks: true,\n globstar: true,\n ignore: [],\n markDirectories: false,\n objectMode: false,\n onlyDirectories: false,\n onlyFiles: true,\n unique: true,\n throwErrorOnBrokenSymbolicLink: false\n};\n\n/** ----------------------------------------------------------------\n * * ***Determines whether a pattern option key is allowed.***\n * ----------------------------------------------------------------\n *\n * Evaluates whether a given {@link PatternOptions | `PatternOptions`}\n * key is permitted under the provided runtime policy.\n *\n * This function enforces restrictions such as:\n *\n * - Disallowing directory-related options when `filesOnly` is enabled.\n * - Preventing external control over the `unique` option when\n * `forceUnique` is enabled.\n *\n * ----------------------------------------------------------------\n *\n * @param key\n * A candidate {@link PatternOptions | `PatternOptions`} property key.\n *\n * @param policy\n * Optional runtime policy controlling which keys are allowed.\n *\n * @returns\n * `true` if the key is permitted under the current policy,\n * otherwise `false`.\n *\n * @internal\n */\nfunction isKeyAllowed(\n key: keyof PatternOptions,\n policy?: PatternRuntimePolicy<boolean, boolean>\n): boolean {\n if (!policy) return true;\n\n if (policy.filesOnly && (key === \"onlyFiles\" || key === \"onlyDirectories\"))\n return false;\n\n if (policy.forceUnique && key === \"unique\") return false;\n\n return true;\n}\n\n/** ----------------------------------------------------------------\n * * ***Runtime whitelist of allowed pattern option keys.***\n * ----------------------------------------------------------------\n *\n * Derived directly from {@link defaultPatternOptions | `defaultPatternOptions`}.\n *\n * This ensures strict synchronization between:\n *\n * - The static {@link PatternOptions | `PatternOptions`} type.\n * - Runtime validation logic used during option sanitization.\n *\n * By deriving the key list from the default configuration,\n * this module avoids manual duplication of allowed option names.\n *\n * ----------------------------------------------------------------\n *\n * This whitelist is used internally to:\n *\n * - Remove unknown properties from user-provided configuration.\n * - Guarantee that only supported options are passed to\n * {@link fg | `fast-glob`}.\n *\n * ----------------------------------------------------------------\n *\n * @internal\n */\nconst PATTERN_OPTION_KEYS = new Set<keyof PatternOptions>(\n Object.keys(defaultPatternOptions) as (keyof PatternOptions)[]\n);\n\n/** ----------------------------------------------------------------\n * * ***Assigns a validated pattern option property.***\n * ----------------------------------------------------------------\n *\n * Performs a type-safe assignment from a source object into a\n * partial {@link PatternOptions | `PatternOptions`} result object.\n *\n * A generic constraint is used to preserve proper indexed access\n * typing and avoid union assignment limitations in TypeScript.\n *\n * This helper assumes that:\n *\n * - The provided `key` has already been validated against\n * {@link PATTERN_OPTION_KEYS | `PATTERN_OPTION_KEYS`}.\n * - The property exists on the `source` object.\n *\n * ----------------------------------------------------------------\n *\n * @template K\n * A valid key of {@link PatternOptions | `PatternOptions`}.\n *\n * @param key\n * The validated pattern option key to assign.\n *\n * @param source\n * The original input object containing the property value.\n *\n * @param target\n * The partial result object receiving the assigned value.\n *\n * @internal\n */\nfunction assignIfAllowed<K extends keyof PatternOptions>(\n key: K,\n source: Record<string, unknown>,\n target: Partial<PatternOptions>\n) {\n target[key] = source[key] as PatternOptions[K];\n}\n\n/** ----------------------------------------------------------------\n * * ***Runtime policy controlling pattern option exposure.***\n * ----------------------------------------------------------------\n *\n * Defines runtime constraints that restrict which fields from\n * {@link PatternOptions | `PatternOptions`} are allowed to appear\n * in the final resolved configuration.\n *\n * This policy is primarily used by higher-level utilities that\n * enforce stricter behavior than the raw {@link fg | `fast-glob`} API.\n *\n * ----------------------------------------------------------------\n *\n * *Supported policies:*\n *\n * - `filesOnly`\n * Prevents directory-related configuration from being externally\n * controlled.\n *\n * - `forceUnique`\n * Ensures that uniqueness behavior is handled internally and\n * cannot be overridden by user configuration.\n *\n * ----------------------------------------------------------------\n *\n * These policies influence both:\n *\n * - Runtime sanitization of user-provided pattern options.\n * - Final resolution of merged configuration values.\n *\n * ----------------------------------------------------------------\n *\n * @template FilesOnly\n * Indicates whether directory-related options should be excluded.\n *\n * @template ForceUnique\n * Indicates whether the `unique` option should be excluded.\n */\nexport type PatternRuntimePolicy<\n FilesOnly extends boolean = boolean,\n ForceUnique extends boolean = boolean\n> = {\n /** ----------------------------------------------------------------\n * * ***Restricts directory-related pattern options.***\n * ----------------------------------------------------------------\n *\n * When enabled, directory filtering options are excluded from the\n * final configuration produced by the pattern resolution process.\n *\n * This prevents external configuration from modifying whether\n * directories or files are matched by the underlying\n * {@link fg | `fast-glob`} operation.\n *\n * ----------------------------------------------------------------\n *\n * *Affected options:*\n *\n * - `onlyFiles`\n * - `onlyDirectories`\n *\n * ----------------------------------------------------------------\n *\n * When `true`, these options are ignored during sanitization and\n * removed from the final resolved configuration.\n *\n * ----------------------------------------------------------------\n * @default false\n */\n filesOnly?: FilesOnly;\n\n /** ----------------------------------------------------------------\n * * ***Enforces internal uniqueness behavior.***\n * ----------------------------------------------------------------\n *\n * When enabled, the `unique` option is excluded from user-provided\n * configuration and controlled internally by the runtime.\n *\n * This ensures that result deduplication behavior cannot be\n * overridden by external configuration.\n *\n * ----------------------------------------------------------------\n *\n * *Affected option:*\n *\n * - `unique`\n *\n * ----------------------------------------------------------------\n *\n * When `true`, this option is ignored during sanitization and\n * removed from the final resolved configuration.\n *\n * ----------------------------------------------------------------\n * @default false\n */\n forceUnique?: ForceUnique;\n};\n\n/** ----------------------------------------------------------------\n * * ***Sanitizes pattern options by removing unknown keys.***\n * ----------------------------------------------------------------\n *\n * Ensures that the provided object only contains keys that exist in\n * {@link defaultPatternOptions | `defaultPatternOptions`}, any unknown keys will be removed.\n *\n * This function is intended for API boundary validation to prevent\n * unsafe or unexpected configuration injection.\n *\n * - *Behavior:*\n * - Ignores non-object values (returns empty object).\n * - Removes keys not present in {@link defaultPatternOptions | `defaultPatternOptions`}.\n * - Does NOT mutate the original object.\n *\n * ----------------------------------------------------------------\n *\n * @param input\n * The value to sanitize.\n *\n * @param policy\n * Optional runtime policy restricting which pattern options\n * are allowed during sanitization.\n *\n * @returns\n * A new object containing only allowed pattern option keys.\n *\n * @example\n * ```ts\n * const userOptions = {\n * absolute: true,\n * dot: true,\n * fakeKey: 123\n * };\n *\n * const clean = sanitizePatternOptions(userOptions);\n *\n * // Result:\n * // {\n * // absolute: true,\n * // dot: true\n * // }\n * ```\n */\nexport function sanitizePatternOptions(\n input: unknown,\n policy?: PatternRuntimePolicy<false, false>\n): Partial<PatternOptions<false, false>>;\nexport function sanitizePatternOptions(\n input: unknown,\n policy?: PatternRuntimePolicy<true, false>\n): Partial<PatternOptions<true, false>>;\nexport function sanitizePatternOptions(\n input: unknown,\n policy?: PatternRuntimePolicy<false, true>\n): Partial<PatternOptions<false, true>>;\nexport function sanitizePatternOptions(\n input: unknown,\n policy?: PatternRuntimePolicy<true, true>\n): Partial<PatternOptions<true, true>>;\nexport function sanitizePatternOptions(\n input: unknown,\n policy?: PatternRuntimePolicy<false, false>\n): Partial<PatternOptions<false, false>>;\nexport function sanitizePatternOptions(\n input: unknown,\n policy?: PatternRuntimePolicy<boolean, boolean>\n): Partial<PatternOptions>;\nexport function sanitizePatternOptions(\n input: unknown,\n policy?: PatternRuntimePolicy<boolean, boolean>\n): Partial<PatternOptions> {\n if (!isPlainObject(input)) return {};\n\n const source = input as Record<string, unknown>;\n const result: Partial<PatternOptions> = {};\n\n for (const key of Object.keys(source) as (keyof PatternOptions)[]) {\n if (PATTERN_OPTION_KEYS.has(key) && isKeyAllowed(key, policy)) {\n assignIfAllowed(key, source, result);\n }\n }\n\n return result;\n}\n\n/** ----------------------------------------------------------------\n * * ***Resolves pattern options with default values.***\n * ----------------------------------------------------------------\n *\n * Applies {@link sanitizePatternOptions | `sanitizePatternOptions`} to the provided input and merges\n * the result with `defaultPatternOptions`.\n *\n * - Unknown keys are removed.\n * - Missing keys fall back to defaults.\n *\n * Guarantees a fully-formed {@link PatternOptions | `PatternOptions`} object safe for direct\n * usage with `fast-glob`.\n *\n * ----------------------------------------------------------------\n *\n * @param input\n * Optional user-provided pattern options.\n *\n * @param policy\n * Optional runtime policy restricting which configuration\n * fields are allowed in the final resolved options.\n *\n * @returns\n * A complete and validated\n * {@link PatternOptions | `PatternOptions`} object ready for\n * direct usage with {@link fg | `fast-glob`}.\n *\n * @example\n * ```ts\n * const options = resolvePatternOptions({\n * dot: true,\n * fakeKey: 123\n * });\n *\n * // Result:\n * // {\n * // absolute: false,\n * // baseNameMatch: false,\n * // ...\n * // dot: true,\n * // ...\n * // }\n *\n * const matched = await fastGlobe(patterns, options);\n * ```\n */\nexport function resolvePatternOptions(\n input: unknown,\n policy?: PatternRuntimePolicy<false, false>\n): PatternOptions<false, false>;\nexport function resolvePatternOptions(\n input: unknown,\n policy?: PatternRuntimePolicy<true, false>\n): PatternOptions<true, false>;\nexport function resolvePatternOptions(\n input: unknown,\n policy?: PatternRuntimePolicy<false, true>\n): PatternOptions<false, true>;\nexport function resolvePatternOptions(\n input: unknown,\n policy?: PatternRuntimePolicy<true, true>\n): PatternOptions<true, true>;\nexport function resolvePatternOptions(\n input: unknown,\n policy?: PatternRuntimePolicy<false, false>\n): PatternOptions<false, false>;\nexport function resolvePatternOptions(\n input: unknown,\n policy?: PatternRuntimePolicy<boolean, boolean>\n): PatternOptions {\n const clean = sanitizePatternOptions(input, policy);\n\n const options: PatternOptions = {\n ...defaultPatternOptions,\n ...clean\n };\n\n if (policy?.filesOnly) {\n delete options.onlyFiles;\n delete options.onlyDirectories;\n }\n\n if (policy?.forceUnique) {\n delete options.unique;\n }\n\n return options;\n}\n\n/** ----------------------------------------------------------------\n * * ***Stable structural equality detector.***\n * ----------------------------------------------------------------\n *\n * Determines whether two values are structurally identical using\n * deterministic serialization via `safeStableStringify`.\n *\n * - *This comparison:*\n * - Preserves `undefined` values.\n * - Sorts object keys.\n * - Sorts arrays (optional structural normalization).\n *\n * - *Ensures stable equality checks for configuration objects where:*\n * - Property order may differ.\n * - Object references are not identical.\n * - Deep comparison is required.\n *\n * ----------------------------------------------------------------\n *\n * @template T - Value type being compared.\n *\n * @param value - The current runtime value.\n * @param defaultValue - The default reference value.\n *\n * @returns\n * - `\"default\"` ➔ If values are structurally identical.\n * - `\"overridden\"` ➔ If values differ.\n *\n * @example\n * ```ts\n * const source = sourceOfPatternOptions(\n * cleanPatternOptions,\n * defaultPatternOptions\n * );\n *\n * // ➔ \"default\" | \"overridden\"\n * ```\n *\n * @internal\n */\nexport function sourceOfPatternOptions<T>(\n value: T,\n defaultValue: T\n): \"default\" | \"overridden\" {\n const stableStringifyOptions = {\n keepUndefined: true,\n sortArray: true,\n sortKeys: true\n } satisfies SafeStableStringifyOptions;\n\n const a = safeStableStringify(value, stableStringifyOptions);\n\n const b = safeStableStringify(defaultValue, stableStringifyOptions);\n\n return a === b ? \"default\" : \"overridden\";\n}\n","import \"@rzl-zone/node-only\";\n\nimport \"dotenv/config\";\n\n// eslint-disable-next-line turbo/no-undeclared-env-vars\nconst USE_EMOJI = process.env.FORCE_EMOJI === \"1\";\n\ntype Icons = {\n readonly [K in keyof typeof emojiIcons]: string;\n};\n\nconst emojiIcons = {\n /* flow */\n start: \"🕐\",\n arrowRight: \"▶️\",\n arrowRightMini: \"›\",\n\n /* list */\n bulletBold: \"●\",\n bullet: \"•\",\n whiteCircle: \"○\",\n whiteBullet: \"◦\",\n smallSquare: \"▪\",\n\n /* status */\n success: \"✅\",\n warn: \"⚠️\",\n error: \"❌\",\n\n /* config */\n config: \"⚙️\",\n settings: \"🛠️\",\n\n /* files & fs */\n file: \"📄\",\n files: \"📁\",\n folder: \"📂\",\n path: \"🧭\",\n\n /* actions */\n add: \"➕\",\n remove: \"➖\",\n update: \"♻️\",\n copy: \"📋\",\n move: \"📦\",\n clean: \"🧹\",\n\n /* build / process */\n build: \"🏗️\",\n generate: \"🧩\",\n compile: \"⚡\",\n watch: \"👀\",\n\n /* info / misc */\n info: \"ℹ️\",\n debug: \"🐛\",\n question: \"❓\",\n separator: \"━\"\n} as const;\n\nconst asciiIcons = {\n /* flow */\n start: \"▶\",\n arrowRight: \"▶\",\n arrowRightMini: \"›\",\n\n /* list */\n bulletBold: \"●\",\n bullet: \"•\",\n whiteCircle: \"○\",\n whiteBullet: \"◦\",\n smallSquare: \"▪\",\n\n /* status */\n success: \"✅\",\n warn: \"⚠️ \",\n error: \"❌\",\n\n /* config */\n config: \"#\",\n settings: \"@\",\n\n /* files & fs */\n file: \"F\",\n files: \"DIR\",\n folder: \"DIR\",\n path: \"~\",\n\n /* actions */\n add: \"+\",\n remove: \"-\",\n update: \"~\",\n copy: \"=\",\n move: \">\",\n clean: \"x\",\n\n /* build / process */\n build: \"#\",\n generate: \"*\",\n compile: \">\",\n watch: \"o\",\n\n /* info / misc */\n info: \"i\",\n debug: \"d\",\n question: \"?\",\n separator: \"-\"\n} as const satisfies Icons;\n\n/** ----------------------------------------------------------------\n * * ***CLI icon mapping (emoji or ASCII fallback).***\n * ----------------------------------------------------------------\n *\n * Provides a centralized set of visual symbols used across the CLI\n * for rendering flow indicators, status messages, filesystem labels,\n * and action markers.\n *\n * - *The icon set is determined at runtime via the environment variable:*\n * - `FORCE_EMOJI=1` ➜ Emoji icons are enabled.\n * - Otherwise ➜ ASCII-safe fallback icons are used.\n *\n * - *This ensures compatibility with:*\n * - Terminals that do not support emoji rendering.\n * - CI environments.\n * - Minimal shells or log files.\n * - *Behavior:*\n * - The object shape is identical in both modes.\n * - Only the visual representation changes.\n * - The value is resolved once at module evaluation time.\n * ----------------------------------------------------------------\n * #### Environment Control\n * ```bash\n * FORCE_EMOJI=1\n * ```\n * ----------------------------------------------------------------\n * @remarks\n * This constant is intended for internal CLI rendering only, do not mutate the returned object.\n *\n * @example\n * ```ts\n * console.log(`${ICONS.success} Build completed`);\n * ```\n *\n */\nexport const ICONS: Readonly<Icons> = Object.freeze(\n USE_EMOJI ? emojiIcons : asciiIcons\n);\n","import \"@rzl-zone/node-only\";\n\nimport _fsExtra from \"fs-extra\";\nimport _fastGlob from \"fast-glob\";\n\nexport { ICONS } from \"@/utils/helper/icons\";\n\n/** ----------------------------------------------------------------\n * * ***Node.js–only filesystem utilities (fs-extra).***\n * ----------------------------------------------------------------\n *\n * This export is a **thin re-export** of the `fs-extra` package,\n * intended for **server-side / Node.js environments only**.\n *\n * ⚠️ **DO NOT import this in browser or client-side code.**\n * The underlying implementation depends on Node.js built-in\n * modules such as `fs`, `path`, and `process`.\n *\n * - *Typical use cases:*\n * - CLI tools.\n * - Build scripts.\n * - File system manipulation on the server.\n *\n * @see {@link https://github.com/jprichardson/node-fs-extra | **`https://github.com/jprichardson/node-fs-extra`**}.\n * @environment node\n */\nexport const fsExtra: typeof _fsExtra = _fsExtra;\n\n/** ----------------------------------------------------------------\n * * ***High-performance file system globbing utility (fast-glob).***\n * ----------------------------------------------------------------\n *\n * This export re-exports the default export of `fast-glob`,\n * which is implemented using **CommonJS `export =` semantics**.\n *\n * Due to its reliance on Node.js APIs, this module is\n * **server-side only** and must not be bundled for the browser.\n *\n * - *Typical use cases:*\n * - Resolving file patterns in build tools.\n * - Scanning project directories.\n * - CLI and automation scripts.\n *\n * @see {@link https://github.com/mrmlnc/fast-glob | **`https://github.com/mrmlnc/fast-glob`**}.\n * @environment node\n */\nexport const fastGlob: typeof _fastGlob = _fastGlob;\n\nexport {\n defaultPatternOptions,\n type PatternConfig,\n type PatternOptions\n} from \"@/_internal/libs/fast-globe-options\";\n"],"mappings":"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"}
1
+ {"version":3,"file":"server-DZvrqlyy.cjs","names":["os","isPlainObject","safeStableStringify","_fsExtra","_fastGlob"],"sources":["../src/_internal/libs/fast-globe-options.ts","../src/utils/helper/icons.ts","../src/utils/server.ts"],"sourcesContent":["import \"@rzl-zone/node-only\";\n\nimport type { OmitStrict, Prettify } from \"../types/extra\";\n\nimport os from \"node:os\";\nimport * as fg from \"fast-glob\";\n\nimport {\n isPlainObject,\n safeStableStringify,\n type SafeStableStringifyOptions\n} from \"@/_internal/utils/helper\";\n\ntype IfTrueGeneric<T extends boolean, K> = T extends true ? K : never;\n\n/** ----------------------------------------------------------------\n * * ***Supported pattern matching options.***\n * ----------------------------------------------------------------\n * Defines the subset of {@link fg | `fast-glob`} options exposed by\n * this module for pattern-based file resolution.\n *\n * This type intentionally omits several low-level or environment-\n * controlled fields to ensure predictable and safe behavior.\n *\n * ----------------------------------------------------------------\n *\n * *Excluded options (managed internally):*\n *\n * - `fs`\n * - `cwd`\n * - `stats`\n * - `deep`\n * - `extglob`\n * - `suppressErrors`\n * - `braceExpansion`\n *\n * These fields are controlled by the runtime environment and should\n * not be overridden by consumers.\n *\n * ----------------------------------------------------------------\n * @template FilesOnly\n * When `true`, directory filtering options (`onlyFiles`, `onlyDirectories`)\n * are removed from the public API surface, preventing consumers from\n * modifying directory matching behavior.\n *\n * @template ForceUnique\n * When `true`, the `unique` option is removed from the public API to enforce internal uniqueness handling.\n *\n * This allows higher-level utilities to guarantee that matched results\n * are always deduplicated.\n *\n * ----------------------------------------------------------------\n *\n * This type serves as the public configuration contract used when\n * resolving glob patterns.\n */\nexport type PatternOptions<\n FilesOnly extends boolean = false,\n ForceUnique extends boolean = false\n> = OmitStrict<\n fg.Options,\n | \"fs\"\n | \"cwd\"\n | \"stats\"\n | \"deep\"\n | \"extglob\"\n | \"suppressErrors\"\n | \"braceExpansion\"\n | \"dot\"\n | IfTrueGeneric<FilesOnly, \"onlyFiles\" | \"onlyDirectories\">\n | IfTrueGeneric<ForceUnique, \"unique\">,\n { skipPrettify: true }\n> & {\n /** Allow patterns to match entries that begin with a period (`.`).\n *\n * @default true\n */\n dot?: boolean;\n};\n\n/** ----------------------------------------------------------------\n * * ***Pattern configuration wrapper.***\n * ----------------------------------------------------------------\n *\n * Provides an optional container for {@link PatternOptions | `PatternOptions`}.\n *\n * This wrapper allows pattern matching configuration to be composed\n * within higher-level configuration objects without flattening\n * the option namespace.\n *\n * ----------------------------------------------------------------\n *\n * @template FilesOnly\n * When `true`, directory-related options (`onlyFiles`, `onlyDirectories`)\n * are removed from the public configuration to enforce file-only matching.\n *\n * @template ForceUnique\n * When `true`, the `unique` option is removed from the underlying\n * {@link PatternOptions | `PatternOptions`} to guarantee deduplicated results.\n *\n * ----------------------------------------------------------------\n *\n * @example\n * ```ts\n * const config: PatternConfig = {\n * patternOptions: {\n * dot: true\n * }\n * };\n * ```\n */\nexport type PatternConfig<\n FilesOnly extends boolean = false,\n ForceUnique extends boolean = false\n> = Prettify<{\n /** ----------------------------------------------------------------\n * * ***Pattern matching options.***\n * ----------------------------------------------------------------\n *\n * Optional configuration for controlling file pattern resolution.\n *\n * When provided, these options are sanitized and merged with\n * the internal default configuration before being passed to\n * {@link fg | `fast-glob`}.\n *\n * @see {@link PatternOptions | `PatternOptions`} for supported fields.\n */\n patternOptions?: PatternOptions<FilesOnly, ForceUnique>;\n}>;\n\n/** ----------------------------------------------------------------\n * * ***Default pattern matching configuration.***\n * ----------------------------------------------------------------\n *\n * Represents the canonical baseline configuration used when\n * resolving pattern options.\n *\n * These values are applied whenever a user does not explicitly\n * provide overrides.\n *\n * This object also acts as the runtime source of truth for\n * allowed pattern option keys.\n */\nexport const defaultPatternOptions: PatternOptions = {\n absolute: false,\n baseNameMatch: false,\n caseSensitiveMatch: true,\n concurrency: os.cpus().length,\n dot: true,\n followSymbolicLinks: true,\n globstar: true,\n ignore: [],\n markDirectories: false,\n objectMode: false,\n onlyDirectories: false,\n onlyFiles: true,\n unique: true,\n throwErrorOnBrokenSymbolicLink: false\n};\n\n/** ----------------------------------------------------------------\n * * ***Determines whether a pattern option key is allowed.***\n * ----------------------------------------------------------------\n *\n * Evaluates whether a given {@link PatternOptions | `PatternOptions`}\n * key is permitted under the provided runtime policy.\n *\n * This function enforces restrictions such as:\n *\n * - Disallowing directory-related options when `filesOnly` is enabled.\n * - Preventing external control over the `unique` option when\n * `forceUnique` is enabled.\n *\n * ----------------------------------------------------------------\n *\n * @param key\n * A candidate {@link PatternOptions | `PatternOptions`} property key.\n *\n * @param policy\n * Optional runtime policy controlling which keys are allowed.\n *\n * @returns\n * `true` if the key is permitted under the current policy,\n * otherwise `false`.\n *\n * @internal\n */\nfunction isKeyAllowed(\n key: keyof PatternOptions,\n policy?: PatternRuntimePolicy<boolean, boolean>\n): boolean {\n if (!policy) return true;\n\n if (policy.filesOnly && (key === \"onlyFiles\" || key === \"onlyDirectories\"))\n return false;\n\n if (policy.forceUnique && key === \"unique\") return false;\n\n return true;\n}\n\n/** ----------------------------------------------------------------\n * * ***Runtime whitelist of allowed pattern option keys.***\n * ----------------------------------------------------------------\n *\n * Derived directly from {@link defaultPatternOptions | `defaultPatternOptions`}.\n *\n * This ensures strict synchronization between:\n *\n * - The static {@link PatternOptions | `PatternOptions`} type.\n * - Runtime validation logic used during option sanitization.\n *\n * By deriving the key list from the default configuration,\n * this module avoids manual duplication of allowed option names.\n *\n * ----------------------------------------------------------------\n *\n * This whitelist is used internally to:\n *\n * - Remove unknown properties from user-provided configuration.\n * - Guarantee that only supported options are passed to\n * {@link fg | `fast-glob`}.\n *\n * ----------------------------------------------------------------\n *\n * @internal\n */\nconst PATTERN_OPTION_KEYS = new Set<keyof PatternOptions>(\n Object.keys(defaultPatternOptions) as (keyof PatternOptions)[]\n);\n\n/** ----------------------------------------------------------------\n * * ***Assigns a validated pattern option property.***\n * ----------------------------------------------------------------\n *\n * Performs a type-safe assignment from a source object into a\n * partial {@link PatternOptions | `PatternOptions`} result object.\n *\n * A generic constraint is used to preserve proper indexed access\n * typing and avoid union assignment limitations in TypeScript.\n *\n * This helper assumes that:\n *\n * - The provided `key` has already been validated against\n * {@link PATTERN_OPTION_KEYS | `PATTERN_OPTION_KEYS`}.\n * - The property exists on the `source` object.\n *\n * ----------------------------------------------------------------\n *\n * @template K\n * A valid key of {@link PatternOptions | `PatternOptions`}.\n *\n * @param key\n * The validated pattern option key to assign.\n *\n * @param source\n * The original input object containing the property value.\n *\n * @param target\n * The partial result object receiving the assigned value.\n *\n * @internal\n */\nfunction assignIfAllowed<K extends keyof PatternOptions>(\n key: K,\n source: Record<string, unknown>,\n target: Partial<PatternOptions>\n) {\n target[key] = source[key] as PatternOptions[K];\n}\n\n/** ----------------------------------------------------------------\n * * ***Runtime policy controlling pattern option exposure.***\n * ----------------------------------------------------------------\n *\n * Defines runtime constraints that restrict which fields from\n * {@link PatternOptions | `PatternOptions`} are allowed to appear\n * in the final resolved configuration.\n *\n * This policy is primarily used by higher-level utilities that\n * enforce stricter behavior than the raw {@link fg | `fast-glob`} API.\n *\n * ----------------------------------------------------------------\n *\n * *Supported policies:*\n *\n * - `filesOnly`\n * Prevents directory-related configuration from being externally\n * controlled.\n *\n * - `forceUnique`\n * Ensures that uniqueness behavior is handled internally and\n * cannot be overridden by user configuration.\n *\n * ----------------------------------------------------------------\n *\n * These policies influence both:\n *\n * - Runtime sanitization of user-provided pattern options.\n * - Final resolution of merged configuration values.\n *\n * ----------------------------------------------------------------\n *\n * @template FilesOnly\n * Indicates whether directory-related options should be excluded.\n *\n * @template ForceUnique\n * Indicates whether the `unique` option should be excluded.\n */\nexport type PatternRuntimePolicy<\n FilesOnly extends boolean = boolean,\n ForceUnique extends boolean = boolean\n> = {\n /** ----------------------------------------------------------------\n * * ***Restricts directory-related pattern options.***\n * ----------------------------------------------------------------\n *\n * When enabled, directory filtering options are excluded from the\n * final configuration produced by the pattern resolution process.\n *\n * This prevents external configuration from modifying whether\n * directories or files are matched by the underlying\n * {@link fg | `fast-glob`} operation.\n *\n * ----------------------------------------------------------------\n *\n * *Affected options:*\n *\n * - `onlyFiles`\n * - `onlyDirectories`\n *\n * ----------------------------------------------------------------\n *\n * When `true`, these options are ignored during sanitization and\n * removed from the final resolved configuration.\n *\n * ----------------------------------------------------------------\n * @default false\n */\n filesOnly?: FilesOnly;\n\n /** ----------------------------------------------------------------\n * * ***Enforces internal uniqueness behavior.***\n * ----------------------------------------------------------------\n *\n * When enabled, the `unique` option is excluded from user-provided\n * configuration and controlled internally by the runtime.\n *\n * This ensures that result deduplication behavior cannot be\n * overridden by external configuration.\n *\n * ----------------------------------------------------------------\n *\n * *Affected option:*\n *\n * - `unique`\n *\n * ----------------------------------------------------------------\n *\n * When `true`, this option is ignored during sanitization and\n * removed from the final resolved configuration.\n *\n * ----------------------------------------------------------------\n * @default false\n */\n forceUnique?: ForceUnique;\n};\n\n/** ----------------------------------------------------------------\n * * ***Sanitizes pattern options by removing unknown keys.***\n * ----------------------------------------------------------------\n *\n * Ensures that the provided object only contains keys that exist in\n * {@link defaultPatternOptions | `defaultPatternOptions`}, any unknown keys will be removed.\n *\n * This function is intended for API boundary validation to prevent\n * unsafe or unexpected configuration injection.\n *\n * - *Behavior:*\n * - Ignores non-object values (returns empty object).\n * - Removes keys not present in {@link defaultPatternOptions | `defaultPatternOptions`}.\n * - Does NOT mutate the original object.\n *\n * ----------------------------------------------------------------\n *\n * @param input\n * The value to sanitize.\n *\n * @param policy\n * Optional runtime policy restricting which pattern options\n * are allowed during sanitization.\n *\n * @returns\n * A new object containing only allowed pattern option keys.\n *\n * @example\n * ```ts\n * const userOptions = {\n * absolute: true,\n * dot: true,\n * fakeKey: 123\n * };\n *\n * const clean = sanitizePatternOptions(userOptions);\n *\n * // Result:\n * // {\n * // absolute: true,\n * // dot: true\n * // }\n * ```\n */\nexport function sanitizePatternOptions(\n input: unknown,\n policy?: PatternRuntimePolicy<false, false>\n): Partial<PatternOptions<false, false>>;\nexport function sanitizePatternOptions(\n input: unknown,\n policy?: PatternRuntimePolicy<true, false>\n): Partial<PatternOptions<true, false>>;\nexport function sanitizePatternOptions(\n input: unknown,\n policy?: PatternRuntimePolicy<false, true>\n): Partial<PatternOptions<false, true>>;\nexport function sanitizePatternOptions(\n input: unknown,\n policy?: PatternRuntimePolicy<true, true>\n): Partial<PatternOptions<true, true>>;\nexport function sanitizePatternOptions(\n input: unknown,\n policy?: PatternRuntimePolicy<false, false>\n): Partial<PatternOptions<false, false>>;\nexport function sanitizePatternOptions(\n input: unknown,\n policy?: PatternRuntimePolicy<boolean, boolean>\n): Partial<PatternOptions>;\nexport function sanitizePatternOptions(\n input: unknown,\n policy?: PatternRuntimePolicy<boolean, boolean>\n): Partial<PatternOptions> {\n if (!isPlainObject(input)) return {};\n\n const source = input as Record<string, unknown>;\n const result: Partial<PatternOptions> = {};\n\n for (const key of Object.keys(source) as (keyof PatternOptions)[]) {\n if (PATTERN_OPTION_KEYS.has(key) && isKeyAllowed(key, policy)) {\n assignIfAllowed(key, source, result);\n }\n }\n\n return result;\n}\n\n/** ----------------------------------------------------------------\n * * ***Resolves pattern options with default values.***\n * ----------------------------------------------------------------\n *\n * Applies {@link sanitizePatternOptions | `sanitizePatternOptions`} to the provided input and merges\n * the result with `defaultPatternOptions`.\n *\n * - Unknown keys are removed.\n * - Missing keys fall back to defaults.\n *\n * Guarantees a fully-formed {@link PatternOptions | `PatternOptions`} object safe for direct\n * usage with `fast-glob`.\n *\n * ----------------------------------------------------------------\n *\n * @param input\n * Optional user-provided pattern options.\n *\n * @param policy\n * Optional runtime policy restricting which configuration\n * fields are allowed in the final resolved options.\n *\n * @returns\n * A complete and validated\n * {@link PatternOptions | `PatternOptions`} object ready for\n * direct usage with {@link fg | `fast-glob`}.\n *\n * @example\n * ```ts\n * const options = resolvePatternOptions({\n * dot: true,\n * fakeKey: 123\n * });\n *\n * // Result:\n * // {\n * // absolute: false,\n * // baseNameMatch: false,\n * // ...\n * // dot: true,\n * // ...\n * // }\n *\n * const matched = await fastGlobe(patterns, options);\n * ```\n */\nexport function resolvePatternOptions(\n input: unknown,\n policy?: PatternRuntimePolicy<false, false>\n): PatternOptions<false, false>;\nexport function resolvePatternOptions(\n input: unknown,\n policy?: PatternRuntimePolicy<true, false>\n): PatternOptions<true, false>;\nexport function resolvePatternOptions(\n input: unknown,\n policy?: PatternRuntimePolicy<false, true>\n): PatternOptions<false, true>;\nexport function resolvePatternOptions(\n input: unknown,\n policy?: PatternRuntimePolicy<true, true>\n): PatternOptions<true, true>;\nexport function resolvePatternOptions(\n input: unknown,\n policy?: PatternRuntimePolicy<false, false>\n): PatternOptions<false, false>;\nexport function resolvePatternOptions(\n input: unknown,\n policy?: PatternRuntimePolicy<boolean, boolean>\n): PatternOptions {\n const clean = sanitizePatternOptions(input, policy);\n\n const options: PatternOptions = {\n ...defaultPatternOptions,\n ...clean\n };\n\n if (policy?.filesOnly) {\n delete options.onlyFiles;\n delete options.onlyDirectories;\n }\n\n if (policy?.forceUnique) {\n delete options.unique;\n }\n\n return options;\n}\n\n/** ----------------------------------------------------------------\n * * ***Stable structural equality detector.***\n * ----------------------------------------------------------------\n *\n * Determines whether two values are structurally identical using\n * deterministic serialization via `safeStableStringify`.\n *\n * - *This comparison:*\n * - Preserves `undefined` values.\n * - Sorts object keys.\n * - Sorts arrays (optional structural normalization).\n *\n * - *Ensures stable equality checks for configuration objects where:*\n * - Property order may differ.\n * - Object references are not identical.\n * - Deep comparison is required.\n *\n * ----------------------------------------------------------------\n *\n * @template T - Value type being compared.\n *\n * @param value - The current runtime value.\n * @param defaultValue - The default reference value.\n *\n * @returns\n * - `\"default\"` ➔ If values are structurally identical.\n * - `\"overridden\"` ➔ If values differ.\n *\n * @example\n * ```ts\n * const source = sourceOfPatternOptions(\n * cleanPatternOptions,\n * defaultPatternOptions\n * );\n *\n * // ➔ \"default\" | \"overridden\"\n * ```\n *\n * @internal\n */\nexport function sourceOfPatternOptions<T>(\n value: T,\n defaultValue: T\n): \"default\" | \"overridden\" {\n const stableStringifyOptions = {\n keepUndefined: true,\n sortArray: true,\n sortKeys: true\n } satisfies SafeStableStringifyOptions;\n\n const a = safeStableStringify(value, stableStringifyOptions);\n\n const b = safeStableStringify(defaultValue, stableStringifyOptions);\n\n return a === b ? \"default\" : \"overridden\";\n}\n","import \"@rzl-zone/node-only\";\n\nimport \"dotenv/config\";\n\n// eslint-disable-next-line turbo/no-undeclared-env-vars\nconst USE_EMOJI = process.env.FORCE_EMOJI === \"1\";\n\ntype Icons = {\n readonly [K in keyof typeof emojiIcons]: string;\n};\n\nconst emojiIcons = {\n /* flow */\n start: \"🕐\",\n arrowRight: \"▶️\",\n arrowRightMini: \"›\",\n\n /* list */\n bulletBold: \"●\",\n bullet: \"•\",\n whiteCircle: \"○\",\n whiteBullet: \"◦\",\n smallSquare: \"▪\",\n\n /* status */\n success: \"✅\",\n warn: \"⚠️\",\n error: \"❌\",\n\n /* config */\n config: \"⚙️\",\n settings: \"🛠️\",\n\n /* files & fs */\n file: \"📄\",\n files: \"📁\",\n folder: \"📂\",\n path: \"🧭\",\n\n /* actions */\n add: \"➕\",\n remove: \"➖\",\n update: \"♻️\",\n copy: \"📋\",\n move: \"📦\",\n clean: \"🧹\",\n\n /* build / process */\n build: \"🏗️\",\n generate: \"🧩\",\n compile: \"⚡\",\n watch: \"👀\",\n\n /* info / misc */\n info: \"ℹ️\",\n debug: \"🐛\",\n question: \"❓\",\n separator: \"━\"\n} as const;\n\nconst asciiIcons = {\n /* flow */\n start: \"▶\",\n arrowRight: \"▶\",\n arrowRightMini: \"›\",\n\n /* list */\n bulletBold: \"●\",\n bullet: \"•\",\n whiteCircle: \"○\",\n whiteBullet: \"◦\",\n smallSquare: \"▪\",\n\n /* status */\n success: \"✅\",\n warn: \"⚠️ \",\n error: \"❌\",\n\n /* config */\n config: \"#\",\n settings: \"@\",\n\n /* files & fs */\n file: \"F\",\n files: \"DIR\",\n folder: \"DIR\",\n path: \"~\",\n\n /* actions */\n add: \"+\",\n remove: \"-\",\n update: \"~\",\n copy: \"=\",\n move: \">\",\n clean: \"x\",\n\n /* build / process */\n build: \"#\",\n generate: \"*\",\n compile: \">\",\n watch: \"o\",\n\n /* info / misc */\n info: \"i\",\n debug: \"d\",\n question: \"?\",\n separator: \"-\"\n} as const satisfies Icons;\n\n/** ----------------------------------------------------------------\n * * ***CLI icon mapping (emoji or ASCII fallback).***\n * ----------------------------------------------------------------\n *\n * Provides a centralized set of visual symbols used across the CLI\n * for rendering flow indicators, status messages, filesystem labels,\n * and action markers.\n *\n * - *The icon set is determined at runtime via the environment variable:*\n * - `FORCE_EMOJI=1` ➜ Emoji icons are enabled.\n * - Otherwise ➜ ASCII-safe fallback icons are used.\n *\n * - *This ensures compatibility with:*\n * - Terminals that do not support emoji rendering.\n * - CI environments.\n * - Minimal shells or log files.\n * - *Behavior:*\n * - The object shape is identical in both modes.\n * - Only the visual representation changes.\n * - The value is resolved once at module evaluation time.\n * ----------------------------------------------------------------\n * #### Environment Control\n * ```bash\n * FORCE_EMOJI=1\n * ```\n * ----------------------------------------------------------------\n * @remarks\n * This constant is intended for internal CLI rendering only, do not mutate the returned object.\n *\n * @example\n * ```ts\n * console.log(`${ICONS.success} Build completed`);\n * ```\n *\n */\nexport const ICONS: Readonly<Icons> = Object.freeze(\n USE_EMOJI ? emojiIcons : asciiIcons\n);\n","import \"@rzl-zone/node-only\";\n\nimport _fsExtra from \"fs-extra\";\nimport _fastGlob from \"fast-glob\";\n\nexport { ICONS } from \"@/utils/helper/icons\";\n\n/** ----------------------------------------------------------------\n * * ***Node.js–only filesystem utilities (fs-extra).***\n * ----------------------------------------------------------------\n *\n * This export is a **thin re-export** of the `fs-extra` package,\n * intended for **server-side / Node.js environments only**.\n *\n * ⚠️ **DO NOT import this in browser or client-side code.**\n * The underlying implementation depends on Node.js built-in\n * modules such as `fs`, `path`, and `process`.\n *\n * - *Typical use cases:*\n * - CLI tools.\n * - Build scripts.\n * - File system manipulation on the server.\n *\n * @see {@link https://github.com/jprichardson/node-fs-extra | **`https://github.com/jprichardson/node-fs-extra`**}.\n * @environment node\n */\nexport const fsExtra: typeof _fsExtra = _fsExtra;\n\n/** ----------------------------------------------------------------\n * * ***High-performance file system globbing utility (fast-glob).***\n * ----------------------------------------------------------------\n *\n * This export re-exports the default export of `fast-glob`,\n * which is implemented using **CommonJS `export =` semantics**.\n *\n * Due to its reliance on Node.js APIs, this module is\n * **server-side only** and must not be bundled for the browser.\n *\n * - *Typical use cases:*\n * - Resolving file patterns in build tools.\n * - Scanning project directories.\n * - CLI and automation scripts.\n *\n * @see {@link https://github.com/mrmlnc/fast-glob | **`https://github.com/mrmlnc/fast-glob`**}.\n * @environment node\n */\nexport const fastGlob: typeof _fastGlob = _fastGlob;\n\nexport {\n defaultPatternOptions,\n type PatternConfig,\n type PatternOptions\n} from \"@/_internal/libs/fast-globe-options\";\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA+IA,MAAa,wBAAwC;CACnD,UAAU;CACV,eAAe;CACf,oBAAoB;CACpB,aAAaA,gBAAG,MAAM,CAAC;CACvB,KAAK;CACL,qBAAqB;CACrB,UAAU;CACV,QAAQ,EAAE;CACV,iBAAiB;CACjB,YAAY;CACZ,iBAAiB;CACjB,WAAW;CACX,QAAQ;CACR,gCAAgC;CACjC;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA6BD,SAAS,aACP,KACA,QACS;AACT,KAAI,CAAC,OAAQ,QAAO;AAEpB,KAAI,OAAO,cAAc,QAAQ,eAAe,QAAQ,mBACtD,QAAO;AAET,KAAI,OAAO,eAAe,QAAQ,SAAU,QAAO;AAEnD,QAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA6BT,MAAM,sBAAsB,IAAI,IAC9B,OAAO,KAAK,sBAAsB,CACnC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAkCD,SAAS,gBACP,KACA,QACA,QACA;AACA,QAAO,OAAO,OAAO;;AAwKvB,SAAgB,uBACd,OACA,QACyB;AACzB,KAAI,CAACC,6BAAc,MAAM,CAAE,QAAO,EAAE;CAEpC,MAAM,SAAS;CACf,MAAM,SAAkC,EAAE;AAE1C,MAAK,MAAM,OAAO,OAAO,KAAK,OAAO,CACnC,KAAI,oBAAoB,IAAI,IAAI,IAAI,aAAa,KAAK,OAAO,CAC3D,iBAAgB,KAAK,QAAQ,OAAO;AAIxC,QAAO;;AAqET,SAAgB,sBACd,OACA,QACgB;CAChB,MAAM,QAAQ,uBAAuB,OAAO,OAAO;CAEnD,MAAM,UAA0B;EAC9B,GAAG;EACH,GAAG;EACJ;AAED,KAAI,QAAQ,WAAW;AACrB,SAAO,QAAQ;AACf,SAAO,QAAQ;;AAGjB,KAAI,QAAQ,YACV,QAAO,QAAQ;AAGjB,QAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA2CT,SAAgB,uBACd,OACA,cAC0B;CAC1B,MAAM,yBAAyB;EAC7B,eAAe;EACf,WAAW;EACX,UAAU;EACX;AAMD,QAJUC,mCAAoB,OAAO,uBAAuB,KAElDA,mCAAoB,cAAc,uBAAuB,GAElD,YAAY;;;;;AChlB/B,MAAM,YAAY,QAAQ,IAAI,gBAAgB;AAM9C,MAAM,aAAa;CAEjB,OAAO;CACP,YAAY;CACZ,gBAAgB;CAGhB,YAAY;CACZ,QAAQ;CACR,aAAa;CACb,aAAa;CACb,aAAa;CAGb,SAAS;CACT,MAAM;CACN,OAAO;CAGP,QAAQ;CACR,UAAU;CAGV,MAAM;CACN,OAAO;CACP,QAAQ;CACR,MAAM;CAGN,KAAK;CACL,QAAQ;CACR,QAAQ;CACR,MAAM;CACN,MAAM;CACN,OAAO;CAGP,OAAO;CACP,UAAU;CACV,SAAS;CACT,OAAO;CAGP,MAAM;CACN,OAAO;CACP,UAAU;CACV,WAAW;CACZ;AAED,MAAM,aAAa;CAEjB,OAAO;CACP,YAAY;CACZ,gBAAgB;CAGhB,YAAY;CACZ,QAAQ;CACR,aAAa;CACb,aAAa;CACb,aAAa;CAGb,SAAS;CACT,MAAM;CACN,OAAO;CAGP,QAAQ;CACR,UAAU;CAGV,MAAM;CACN,OAAO;CACP,QAAQ;CACR,MAAM;CAGN,KAAK;CACL,QAAQ;CACR,QAAQ;CACR,MAAM;CACN,MAAM;CACN,OAAO;CAGP,OAAO;CACP,UAAU;CACV,SAAS;CACT,OAAO;CAGP,MAAM;CACN,OAAO;CACP,UAAU;CACV,WAAW;CACZ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAqCD,MAAa,QAAyB,OAAO,OAC3C,YAAY,aAAa,WAC1B;;;;;;;;;;;;;;;;;;;;;;;ACxHD,MAAa,UAA2BC;;;;;;;;;;;;;;;;;;;AAoBxC,MAAa,WAA6BC"}
@@ -2,7 +2,7 @@
2
2
  * ========================================================================
3
3
  * @rzl-zone/build-tools
4
4
  * ------------------------------------------------------------------------
5
- * Version: `0.0.9`
5
+ * Version: `0.0.10`
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
  * ========================================================================
@@ -10,7 +10,7 @@
10
10
 
11
11
  "use strict";
12
12
  Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
13
- const require_client = require('../client-C3jHSAqV.cjs');
13
+ const require_client = require('../client-DnTjQyyo.cjs');
14
14
  exports.ConfigurationError = require_client.ConfigurationError;
15
15
  exports.EOL = require_client.EOL;
16
16
  exports.NEWLINE = require_client.NEWLINE;
@@ -2,7 +2,7 @@
2
2
  * ========================================================================
3
3
  * @rzl-zone/build-tools
4
4
  * ------------------------------------------------------------------------
5
- * Version: `0.0.9`
5
+ * Version: `0.0.10`
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
  * ========================================================================
@@ -348,9 +348,21 @@ declare function joinLines(...text: Array<string | false | null | undefined>): s
348
348
  */
349
349
  declare function joinLinesLoose(...text: Array<string | false | null | undefined>): string;
350
350
  type FormatOptionValueOptions = {
351
- /** @default false */pretty?: boolean; /** @default 2 */
352
- indent?: number; /** @default false */
353
- sortKeys?: boolean; /** @default false */
351
+ /**
352
+ * @default false
353
+ */
354
+ pretty?: boolean;
355
+ /**
356
+ * @default 2
357
+ */
358
+ indent?: number;
359
+ /**
360
+ * @default false
361
+ */
362
+ sortKeys?: boolean;
363
+ /**
364
+ * @default false
365
+ */
354
366
  sortArray?: boolean;
355
367
  };
356
368
  /** ----------------------------------------------------------------
@@ -433,11 +445,17 @@ declare function formatOptionValue(value: unknown, options?: FormatOptionValueOp
433
445
  * - Intended for machine-readable data (not human-facing text).
434
446
  */
435
447
  interface ConfigurationErrorDetails {
436
- /** * ***The actual received value that caused the validation failure.*** */
448
+ /** * ***The actual received value that caused the validation failure.***
449
+ *
450
+ */
437
451
  readonly received?: unknown;
438
- /** * ***Logical origin of the validation (e.g. function name).*** */
452
+ /** * ***Logical origin of the validation (e.g. function name).***
453
+ *
454
+ */
439
455
  readonly context?: string;
440
- /** * ***Additional arbitrary metadata.*** */
456
+ /** * ***Additional arbitrary metadata.***
457
+ *
458
+ */
441
459
  readonly [key: string]: unknown;
442
460
  }
443
461
  /** ----------------------------------------------------------------