@powerlines/core 0.13.4 → 0.13.6

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.
@@ -1,7 +1,7 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
+ const require_environments = require('./environments.cjs');
2
3
  const require_commands = require('./commands.cjs');
3
4
  const require_plugin = require('./plugin.cjs');
4
- const require_environments = require('./environments.cjs');
5
5
  const require_fs = require('./fs.cjs');
6
6
  const require_hooks = require('./hooks.cjs');
7
7
  const require_meta = require('./meta.cjs');
@@ -1,6 +1,6 @@
1
+ import { CLIENT_ENVIRONMENT, DEFAULT_ENVIRONMENT, GLOBAL_ENVIRONMENT, RSC_ENVIRONMENT, SERVER_ENVIRONMENT, SSR_ENVIRONMENT } from "./environments.mjs";
1
2
  import { SUPPORTED_COMMANDS } from "./commands.mjs";
2
3
  import { BUILDER_VARIANTS, KNOWN_PLUGIN_FIELDS, PLUGIN_HOOKS_FIELDS, PLUGIN_NON_HOOK_FIELDS, UNPLUGIN_BUILDER_VARIANTS } from "./plugin.mjs";
3
- import { CLIENT_ENVIRONMENT, DEFAULT_ENVIRONMENT, GLOBAL_ENVIRONMENT, RSC_ENVIRONMENT, SERVER_ENVIRONMENT, SSR_ENVIRONMENT } from "./environments.mjs";
4
4
  import { STORAGE_PRESETS, __VFS_PATCH__, __VFS_REVERT__ } from "./fs.mjs";
5
5
  import { HOOKS_LIST_ORDERS } from "./hooks.mjs";
6
6
  import { CACHE_HASH_LENGTH, ROOT_HASH_LENGTH } from "./meta.mjs";
@@ -1,5 +1,6 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
2
  const require_runtime = require('../_virtual/_rolldown/runtime.cjs');
3
+ const require_environments = require('../constants/environments.cjs');
3
4
  let _storm_software_config_tools_logger = require("@storm-software/config-tools/logger");
4
5
  let _storm_software_config_tools_types = require("@storm-software/config-tools/types");
5
6
  let _storm_software_config_tools_utilities_colors = require("@storm-software/config-tools/utilities/colors");
@@ -24,7 +25,7 @@ const createLog = (name, options = {}) => {
24
25
  return (type, ...args) => (0, _storm_software_config_tools_logger.getLogFn)((0, _storm_software_config_tools_logger.getLogLevel)(type), {
25
26
  ...options,
26
27
  logLevel
27
- })(`${chalk.default.bold.hex((0, _storm_software_config_tools_utilities_colors.getColor)("brand", options))(`${name ? (0, _stryke_string_format_kebab_case.kebabCase)(name) : ""}${options.name ? `${name ? chalk.default.gray(" > ") : ""}${(0, _stryke_string_format_kebab_case.kebabCase)(options.name)}` : ""}${chalk.default.gray(" > ")}`)}${args.join(" ")} `.trim());
28
+ })(`${chalk.default.bold.hex((0, _storm_software_config_tools_utilities_colors.getColor)("brand", options))(`${name ? (0, _stryke_string_format_kebab_case.kebabCase)(name) : ""}${options.command ? chalk.default.dim(` [${options.command}]`) : ""}${name ? chalk.default.gray(" > ") : ""}${options.name ? `${(0, _stryke_string_format_kebab_case.kebabCase)(options.name)}${chalk.default.gray(" > ")}` : ""}${options.environment && options.environment !== "default" ? `${(0, _stryke_string_format_kebab_case.kebabCase)(options.environment)}${chalk.default.gray(" > ")}` : ""}`)}${args.join(" ")} `.trim());
28
29
  };
29
30
  const BADGE_COLORS = [
30
31
  "#00A0DD",
@@ -87,7 +88,7 @@ const colorBackground = (text) => {
87
88
  * @returns A new logging function that includes the badge in its output.
88
89
  */
89
90
  const extendLog = (logFn, name) => {
90
- return (type, ...args) => logFn(type, ` ${colorBackground(name)} ${args.join(" ")} `);
91
+ return (type, ...args) => logFn(type, `${colorBackground(name)} ${args.filter(Boolean).map((arg) => String(arg).trim()).join(" ")} `);
91
92
  };
92
93
 
93
94
  //#endregion
@@ -4,6 +4,8 @@ import { LogLevelLabel } from "@storm-software/config-tools/types";
4
4
  //#region src/lib/logger.d.ts
5
5
  interface CreateLogOptions {
6
6
  name?: string;
7
+ command?: string;
8
+ environment?: string;
7
9
  logLevel?: LogLevelLabel | null;
8
10
  customLogger?: LogFn;
9
11
  colors?: WorkspaceConfig["colors"];
@@ -1 +1 @@
1
- {"version":3,"file":"logger.d.cts","names":[],"sources":["../../src/lib/logger.ts"],"mappings":";;;;UA2BiB,gBAAA;EACf,IAAA;EACA,QAAA,GAAW,aAAA;EACX,YAAA,GAAe,KAAA;EACf,MAAA,GAAS,eAAA;AAAA;;;;;;;;cAUE,SAAA,GACX,IAAA,iBACA,OAAA,GAAS,gBAAA,KACR,KAAA;;;;;;;cAyDU,YAAA,GAAgB,IAAA;;;;;;;cAiBhB,SAAA,GAAa,IAAA;;;AAjB1B;;;;cA6Ba,eAAA,GAAmB,IAAA;AAZhC;;;;;AAYA;;AAZA,cAyBa,SAAA,GAAa,KAAA,EAAO,KAAA,EAAO,IAAA,aAAe,KAAA;AAAA"}
1
+ {"version":3,"file":"logger.d.cts","names":[],"sources":["../../src/lib/logger.ts"],"mappings":";;;;UA4BiB,gBAAA;EACf,IAAA;EACA,OAAA;EACA,WAAA;EACA,QAAA,GAAW,aAAA;EACX,YAAA,GAAe,KAAA;EACf,MAAA,GAAS,eAAA;AAAA;;;;;;;;cAUE,SAAA,GACX,IAAA,iBACA,OAAA,GAAS,gBAAA,KACR,KAAA;;;;;;;cAiEU,YAAA,GAAgB,IAAA;;;;;;;cAiBhB,SAAA,GAAa,IAAA;;;AAjB1B;;;;cA6Ba,eAAA,GAAmB,IAAA;AAZhC;;;;;AAYA;;AAZA,cAyBa,SAAA,GAAa,KAAA,EAAO,KAAA,EAAO,IAAA,aAAe,KAAA;AAAA"}
@@ -4,6 +4,8 @@ import { LogLevelLabel } from "@storm-software/config-tools/types";
4
4
  //#region src/lib/logger.d.ts
5
5
  interface CreateLogOptions {
6
6
  name?: string;
7
+ command?: string;
8
+ environment?: string;
7
9
  logLevel?: LogLevelLabel | null;
8
10
  customLogger?: LogFn;
9
11
  colors?: WorkspaceConfig["colors"];
@@ -1 +1 @@
1
- {"version":3,"file":"logger.d.mts","names":[],"sources":["../../src/lib/logger.ts"],"mappings":";;;;UA2BiB,gBAAA;EACf,IAAA;EACA,QAAA,GAAW,aAAA;EACX,YAAA,GAAe,KAAA;EACf,MAAA,GAAS,eAAA;AAAA;;;;;;;;cAUE,SAAA,GACX,IAAA,iBACA,OAAA,GAAS,gBAAA,KACR,KAAA;;;;;;;cAyDU,YAAA,GAAgB,IAAA;;;;;;;cAiBhB,SAAA,GAAa,IAAA;;;AAjB1B;;;;cA6Ba,eAAA,GAAmB,IAAA;AAZhC;;;;;AAYA;;AAZA,cAyBa,SAAA,GAAa,KAAA,EAAO,KAAA,EAAO,IAAA,aAAe,KAAA;AAAA"}
1
+ {"version":3,"file":"logger.d.mts","names":[],"sources":["../../src/lib/logger.ts"],"mappings":";;;;UA4BiB,gBAAA;EACf,IAAA;EACA,OAAA;EACA,WAAA;EACA,QAAA,GAAW,aAAA;EACX,YAAA,GAAe,KAAA;EACf,MAAA,GAAS,eAAA;AAAA;;;;;;;;cAUE,SAAA,GACX,IAAA,iBACA,OAAA,GAAS,gBAAA,KACR,KAAA;;;;;;;cAiEU,YAAA,GAAgB,IAAA;;;;;;;cAiBhB,SAAA,GAAa,IAAA;;;AAjB1B;;;;cA6Ba,eAAA,GAAmB,IAAA;AAZhC;;;;;AAYA;;AAZA,cAyBa,SAAA,GAAa,KAAA,EAAO,KAAA,EAAO,IAAA,aAAe,KAAA;AAAA"}
@@ -1,3 +1,4 @@
1
+ import { DEFAULT_ENVIRONMENT } from "../constants/environments.mjs";
1
2
  import { getLogFn, getLogLevel } from "@storm-software/config-tools/logger";
2
3
  import { LogLevelLabel } from "@storm-software/config-tools/types";
3
4
  import { getColor } from "@storm-software/config-tools/utilities/colors";
@@ -21,7 +22,7 @@ const createLog = (name, options = {}) => {
21
22
  return (type, ...args) => getLogFn(getLogLevel(type), {
22
23
  ...options,
23
24
  logLevel
24
- })(`${chalk.bold.hex(getColor("brand", options))(`${name ? kebabCase(name) : ""}${options.name ? `${name ? chalk.gray(" > ") : ""}${kebabCase(options.name)}` : ""}${chalk.gray(" > ")}`)}${args.join(" ")} `.trim());
25
+ })(`${chalk.bold.hex(getColor("brand", options))(`${name ? kebabCase(name) : ""}${options.command ? chalk.dim(` [${options.command}]`) : ""}${name ? chalk.gray(" > ") : ""}${options.name ? `${kebabCase(options.name)}${chalk.gray(" > ")}` : ""}${options.environment && options.environment !== "default" ? `${kebabCase(options.environment)}${chalk.gray(" > ")}` : ""}`)}${args.join(" ")} `.trim());
25
26
  };
26
27
  const BADGE_COLORS = [
27
28
  "#00A0DD",
@@ -84,7 +85,7 @@ const colorBackground = (text) => {
84
85
  * @returns A new logging function that includes the badge in its output.
85
86
  */
86
87
  const extendLog = (logFn, name) => {
87
- return (type, ...args) => logFn(type, ` ${colorBackground(name)} ${args.join(" ")} `);
88
+ return (type, ...args) => logFn(type, `${colorBackground(name)} ${args.filter(Boolean).map((arg) => String(arg).trim()).join(" ")} `);
88
89
  };
89
90
 
90
91
  //#endregion
@@ -1 +1 @@
1
- {"version":3,"file":"logger.mjs","names":[],"sources":["../../src/lib/logger.ts"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Powerlines\n\n This code was released as part of the Powerlines project. Powerlines\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/powerlines.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/powerlines\n Documentation: https://docs.stormsoftware.com/projects/powerlines\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport { getLogFn, getLogLevel } from \"@storm-software/config-tools/logger\";\nimport { LogLevelLabel } from \"@storm-software/config-tools/types\";\nimport { getColor } from \"@storm-software/config-tools/utilities/colors\";\nimport { noop } from \"@stryke/helpers/noop\";\nimport { kebabCase } from \"@stryke/string-format/kebab-case\";\nimport { titleCase } from \"@stryke/string-format/title-case\";\nimport chalk from \"chalk\";\nimport type { LogFn, WorkspaceConfig } from \"../types\";\n\nexport interface CreateLogOptions {\n name?: string;\n logLevel?: LogLevelLabel | null;\n customLogger?: LogFn;\n colors?: WorkspaceConfig[\"colors\"];\n}\n\n/**\n * Create a logging function with a specific name and options.\n *\n * @param name - The name of the logging function.\n * @param options - The options to configure the logging function.\n * @returns A logging function.\n */\nexport const createLog = (\n name: string | null,\n options: CreateLogOptions = {}\n): LogFn => {\n const logLevel =\n options.logLevel === null\n ? LogLevelLabel.SILENT\n : options.logLevel || LogLevelLabel.INFO;\n if (logLevel === LogLevelLabel.SILENT) {\n return noop;\n }\n\n if (options.customLogger) {\n return options.customLogger;\n }\n\n return (type: LogLevelLabel, ...args: string[]) =>\n getLogFn(getLogLevel(type), {\n ...options,\n logLevel\n })(\n `${chalk.bold.hex(\n getColor(\"brand\", options as Parameters<typeof getColor>[1])\n )(\n `${name ? kebabCase(name) : \"\"}${options.name ? `${name ? chalk.gray(\" > \") : \"\"}${kebabCase(options.name)}` : \"\"}${chalk.gray(\" > \")}`\n )}${args.join(\" \")} `.trim()\n );\n};\n\nconst BADGE_COLORS = [\n \"#00A0DD\",\n \"#6FCE4E\",\n \"#FBBF24\",\n \"#F43F5E\",\n \"#3B82F6\",\n \"#A855F7\",\n \"#469592\",\n \"#288EDF\",\n \"#D8B4FE\",\n \"#10B981\",\n \"#EF4444\",\n \"#F0EC56\",\n \"#F472B6\",\n \"#22D3EE\",\n \"#EAB308\",\n \"#84CC16\",\n \"#F87171\",\n \"#0EA5E9\",\n \"#D946EF\",\n \"#FACC15\",\n \"#34D399\",\n \"#8B5CF6\"\n] as const;\n\n/**\n * Generate a consistent color based on the input text.\n *\n * @param text - The input text to generate the color from.\n * @return A hexadecimal color string.\n */\nexport const getTextColor = (text: string): string => {\n return (\n BADGE_COLORS[\n text\n .split(\"\")\n .map(char => char.charCodeAt(0))\n .reduce((ret, charCode) => ret + charCode, 0) % BADGE_COLORS.length\n ] || BADGE_COLORS[0]\n );\n};\n\n/**\n * Generate a consistent color based on the input text.\n *\n * @param text - The input text to generate the color from.\n * @return A hexadecimal color string.\n */\nexport const colorText = (text: string): string => {\n const title = titleCase(text);\n\n return chalk.hex(getTextColor(title))(title);\n};\n\n/**\n * Generate a consistent color based on the input text.\n *\n * @param text - The input text to generate the color from.\n * @return A hexadecimal color string.\n */\nexport const colorBackground = (text: string): string => {\n const title = titleCase(text);\n\n return chalk.inverse.hex(getTextColor(title))(` ${title} `);\n};\n\n/**\n * Extend a logging function with a specific name, adding a colored badge to the log output.\n *\n * @param logFn - The original logging function to extend.\n * @param name - The name to use for the badge in the log output.\n * @returns A new logging function that includes the badge in its output.\n */\nexport const extendLog = (logFn: LogFn, name: string): LogFn => {\n return (type: LogLevelLabel, ...args: string[]) =>\n logFn(type, ` ${colorBackground(name)} ${args.join(\" \")} `);\n};\n"],"mappings":";;;;;;;;;;;;;;;;AAyCA,MAAa,aACX,MACA,UAA4B,EAAE,KACpB;CACV,MAAM,WACJ,QAAQ,aAAa,OACjB,cAAc,SACd,QAAQ,YAAY,cAAc;AACxC,KAAI,aAAa,cAAc,OAC7B,QAAO;AAGT,KAAI,QAAQ,aACV,QAAO,QAAQ;AAGjB,SAAQ,MAAqB,GAAG,SAC9B,SAAS,YAAY,KAAK,EAAE;EAC1B,GAAG;EACH;EACD,CAAC,CACA,GAAG,MAAM,KAAK,IACZ,SAAS,SAAS,QAA0C,CAC7D,CACC,GAAG,OAAO,UAAU,KAAK,GAAG,KAAK,QAAQ,OAAO,GAAG,OAAO,MAAM,KAAK,MAAM,GAAG,KAAK,UAAU,QAAQ,KAAK,KAAK,KAAK,MAAM,KAAK,MAAM,GACtI,GAAG,KAAK,KAAK,IAAI,CAAC,GAAG,MAAM,CAC7B;;AAGL,MAAM,eAAe;CACnB;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACD;;;;;;;AAQD,MAAa,gBAAgB,SAAyB;AACpD,QACE,aACE,KACG,MAAM,GAAG,CACT,KAAI,SAAQ,KAAK,WAAW,EAAE,CAAC,CAC/B,QAAQ,KAAK,aAAa,MAAM,UAAU,EAAE,GAAG,aAAa,WAC5D,aAAa;;;;;;;;AAUtB,MAAa,aAAa,SAAyB;CACjD,MAAM,QAAQ,UAAU,KAAK;AAE7B,QAAO,MAAM,IAAI,aAAa,MAAM,CAAC,CAAC,MAAM;;;;;;;;AAS9C,MAAa,mBAAmB,SAAyB;CACvD,MAAM,QAAQ,UAAU,KAAK;AAE7B,QAAO,MAAM,QAAQ,IAAI,aAAa,MAAM,CAAC,CAAC,IAAI,MAAM,GAAG;;;;;;;;;AAU7D,MAAa,aAAa,OAAc,SAAwB;AAC9D,SAAQ,MAAqB,GAAG,SAC9B,MAAM,MAAM,IAAI,gBAAgB,KAAK,CAAC,IAAI,KAAK,KAAK,IAAI,CAAC,GAAG"}
1
+ {"version":3,"file":"logger.mjs","names":[],"sources":["../../src/lib/logger.ts"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Powerlines\n\n This code was released as part of the Powerlines project. Powerlines\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/powerlines.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/powerlines\n Documentation: https://docs.stormsoftware.com/projects/powerlines\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport { getLogFn, getLogLevel } from \"@storm-software/config-tools/logger\";\nimport { LogLevelLabel } from \"@storm-software/config-tools/types\";\nimport { getColor } from \"@storm-software/config-tools/utilities/colors\";\nimport { noop } from \"@stryke/helpers/noop\";\nimport { kebabCase } from \"@stryke/string-format/kebab-case\";\nimport { titleCase } from \"@stryke/string-format/title-case\";\nimport chalk from \"chalk\";\nimport { DEFAULT_ENVIRONMENT } from \"../constants/environments\";\nimport type { LogFn, WorkspaceConfig } from \"../types\";\n\nexport interface CreateLogOptions {\n name?: string;\n command?: string;\n environment?: string;\n logLevel?: LogLevelLabel | null;\n customLogger?: LogFn;\n colors?: WorkspaceConfig[\"colors\"];\n}\n\n/**\n * Create a logging function with a specific name and options.\n *\n * @param name - The name of the logging function.\n * @param options - The options to configure the logging function.\n * @returns A logging function.\n */\nexport const createLog = (\n name: string | null,\n options: CreateLogOptions = {}\n): LogFn => {\n const logLevel =\n options.logLevel === null\n ? LogLevelLabel.SILENT\n : options.logLevel || LogLevelLabel.INFO;\n if (logLevel === LogLevelLabel.SILENT) {\n return noop;\n }\n\n if (options.customLogger) {\n return options.customLogger;\n }\n\n return (type: LogLevelLabel, ...args: string[]) =>\n getLogFn(getLogLevel(type), {\n ...options,\n logLevel\n })(\n `${chalk.bold.hex(\n getColor(\"brand\", options as Parameters<typeof getColor>[1])\n )(\n `${name ? kebabCase(name) : \"\"}${\n options.command ? chalk.dim(` [${options.command}]`) : \"\"\n }${name ? chalk.gray(\" > \") : \"\"}${\n options.name ? `${kebabCase(options.name)}${chalk.gray(\" > \")}` : \"\"\n }${\n options.environment && options.environment !== DEFAULT_ENVIRONMENT\n ? `${kebabCase(options.environment)}${chalk.gray(\" > \")}`\n : \"\"\n }`\n )}${args.join(\" \")} `.trim()\n );\n};\n\nconst BADGE_COLORS = [\n \"#00A0DD\",\n \"#6FCE4E\",\n \"#FBBF24\",\n \"#F43F5E\",\n \"#3B82F6\",\n \"#A855F7\",\n \"#469592\",\n \"#288EDF\",\n \"#D8B4FE\",\n \"#10B981\",\n \"#EF4444\",\n \"#F0EC56\",\n \"#F472B6\",\n \"#22D3EE\",\n \"#EAB308\",\n \"#84CC16\",\n \"#F87171\",\n \"#0EA5E9\",\n \"#D946EF\",\n \"#FACC15\",\n \"#34D399\",\n \"#8B5CF6\"\n] as const;\n\n/**\n * Generate a consistent color based on the input text.\n *\n * @param text - The input text to generate the color from.\n * @return A hexadecimal color string.\n */\nexport const getTextColor = (text: string): string => {\n return (\n BADGE_COLORS[\n text\n .split(\"\")\n .map(char => char.charCodeAt(0))\n .reduce((ret, charCode) => ret + charCode, 0) % BADGE_COLORS.length\n ] || BADGE_COLORS[0]\n );\n};\n\n/**\n * Generate a consistent color based on the input text.\n *\n * @param text - The input text to generate the color from.\n * @return A hexadecimal color string.\n */\nexport const colorText = (text: string): string => {\n const title = titleCase(text);\n\n return chalk.hex(getTextColor(title))(title);\n};\n\n/**\n * Generate a consistent color based on the input text.\n *\n * @param text - The input text to generate the color from.\n * @return A hexadecimal color string.\n */\nexport const colorBackground = (text: string): string => {\n const title = titleCase(text);\n\n return chalk.inverse.hex(getTextColor(title))(` ${title} `);\n};\n\n/**\n * Extend a logging function with a specific name, adding a colored badge to the log output.\n *\n * @param logFn - The original logging function to extend.\n * @param name - The name to use for the badge in the log output.\n * @returns A new logging function that includes the badge in its output.\n */\nexport const extendLog = (logFn: LogFn, name: string): LogFn => {\n return (type: LogLevelLabel, ...args: string[]) =>\n logFn(\n type,\n `${colorBackground(name)} ${args\n .filter(Boolean)\n .map(arg => String(arg).trim())\n .join(\" \")} `\n );\n};\n"],"mappings":";;;;;;;;;;;;;;;;;AA4CA,MAAa,aACX,MACA,UAA4B,EAAE,KACpB;CACV,MAAM,WACJ,QAAQ,aAAa,OACjB,cAAc,SACd,QAAQ,YAAY,cAAc;AACxC,KAAI,aAAa,cAAc,OAC7B,QAAO;AAGT,KAAI,QAAQ,aACV,QAAO,QAAQ;AAGjB,SAAQ,MAAqB,GAAG,SAC9B,SAAS,YAAY,KAAK,EAAE;EAC1B,GAAG;EACH;EACD,CAAC,CACA,GAAG,MAAM,KAAK,IACZ,SAAS,SAAS,QAA0C,CAC7D,CACC,GAAG,OAAO,UAAU,KAAK,GAAG,KAC1B,QAAQ,UAAU,MAAM,IAAI,KAAK,QAAQ,QAAQ,GAAG,GAAG,KACtD,OAAO,MAAM,KAAK,MAAM,GAAG,KAC5B,QAAQ,OAAO,GAAG,UAAU,QAAQ,KAAK,GAAG,MAAM,KAAK,MAAM,KAAK,KAElE,QAAQ,eAAe,QAAQ,4BAC3B,GAAG,UAAU,QAAQ,YAAY,GAAG,MAAM,KAAK,MAAM,KACrD,KAEP,GAAG,KAAK,KAAK,IAAI,CAAC,GAAG,MAAM,CAC7B;;AAGL,MAAM,eAAe;CACnB;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACD;;;;;;;AAQD,MAAa,gBAAgB,SAAyB;AACpD,QACE,aACE,KACG,MAAM,GAAG,CACT,KAAI,SAAQ,KAAK,WAAW,EAAE,CAAC,CAC/B,QAAQ,KAAK,aAAa,MAAM,UAAU,EAAE,GAAG,aAAa,WAC5D,aAAa;;;;;;;;AAUtB,MAAa,aAAa,SAAyB;CACjD,MAAM,QAAQ,UAAU,KAAK;AAE7B,QAAO,MAAM,IAAI,aAAa,MAAM,CAAC,CAAC,MAAM;;;;;;;;AAS9C,MAAa,mBAAmB,SAAyB;CACvD,MAAM,QAAQ,UAAU,KAAK;AAE7B,QAAO,MAAM,QAAQ,IAAI,aAAa,MAAM,CAAC,CAAC,IAAI,MAAM,GAAG;;;;;;;;;AAU7D,MAAa,aAAa,OAAc,SAAwB;AAC9D,SAAQ,MAAqB,GAAG,SAC9B,MACE,MACA,GAAG,gBAAgB,KAAK,CAAC,GAAG,KACzB,OAAO,QAAQ,CACf,KAAI,QAAO,OAAO,IAAI,CAAC,MAAM,CAAC,CAC9B,KAAK,IAAI,CAAC,GACd"}
@@ -53,7 +53,7 @@ function createUnplugin(context, options = {}) {
53
53
  try {
54
54
  const { resolveId, load } = require_lib_unplugin_module_resolution.createUnpluginModuleResolutionFunctions(context, options);
55
55
  async function buildStart() {
56
- log(_storm_software_config_tools_types.LogLevelLabel.DEBUG, "Powerlines build plugin starting...");
56
+ if (!options.silenceHookLogging) log(_storm_software_config_tools_types.LogLevelLabel.DEBUG, "Powerlines build plugin starting...");
57
57
  await ctx.$$internal.callHook("buildStart", { sequential: true });
58
58
  }
59
59
  async function transform(code, id) {
@@ -65,11 +65,11 @@ function createUnplugin(context, options = {}) {
65
65
  return transformed;
66
66
  }
67
67
  async function buildEnd() {
68
- log(_storm_software_config_tools_types.LogLevelLabel.DEBUG, "Powerlines build plugin finishing...");
68
+ if (!options.silenceHookLogging) log(_storm_software_config_tools_types.LogLevelLabel.DEBUG, "Powerlines build plugin finishing...");
69
69
  return ctx.$$internal.callHook("buildEnd", { sequential: true });
70
70
  }
71
71
  async function writeBundle() {
72
- log(_storm_software_config_tools_types.LogLevelLabel.DEBUG, "Finalizing Powerlines project output...");
72
+ if (!options.silenceHookLogging) log(_storm_software_config_tools_types.LogLevelLabel.DEBUG, "Finalizing Powerlines project output...");
73
73
  return ctx.$$internal.callHook("writeBundle", { sequential: true });
74
74
  }
75
75
  return {
@@ -21,7 +21,14 @@ interface CreateUnpluginResolverOptions extends CreateUnpluginModuleResolutionFu
21
21
  * @returns The unplugin instance.
22
22
  */
23
23
  declare function createUnpluginResolver<TContext extends PluginContext = PluginContext>(context: TContext, options?: CreateUnpluginResolverOptions): UnpluginFactory<TContext>;
24
- interface CreateUnpluginOptions extends CreateUnpluginResolverOptions {}
24
+ interface CreateUnpluginOptions extends CreateUnpluginResolverOptions {
25
+ /**
26
+ * Whether to silence logging for the plugin hooks. This can be useful for plugins that run frequently or have hooks that are called often, to reduce noise in the logs. When set to `true`, the plugin will not log any messages for its hooks. When set to `false` (the default), the plugin will log messages for its hooks as normal.
27
+ *
28
+ * @defaultValue false
29
+ */
30
+ silenceHookLogging?: boolean;
31
+ }
25
32
  /**
26
33
  * Creates a Powerlines unplugin instance.
27
34
  *
@@ -1 +1 @@
1
- {"version":3,"file":"plugin.d.cts","names":[],"sources":["../../../src/lib/unplugin/plugin.ts"],"mappings":";;;;;UAsCiB,6BAAA,SAAsC,8CAAA;;AAAvD;;;;;AAkBA;;EATE,IAAA;AAAA;;;;;;;iBASc,sBAAA,kBACG,aAAA,GAAgB,aAAA,CAAA,CAEjC,OAAA,EAAS,QAAA,EACT,OAAA,GAAS,6BAAA,GACR,eAAA,CAAgB,QAAA;AAAA,UA+BF,qBAAA,SAA8B,6BAAA;;;;;;;iBAQ/B,cAAA,kBAAgC,aAAA,GAAgB,aAAA,CAAA,CAC9D,OAAA,EAAS,QAAA,EACT,OAAA,GAAS,qBAAA,GACR,eAAA,CAAgB,QAAA;AAAA"}
1
+ {"version":3,"file":"plugin.d.cts","names":[],"sources":["../../../src/lib/unplugin/plugin.ts"],"mappings":";;;;;UAsCiB,6BAAA,SAAsC,8CAAA;;AAAvD;;;;;AAkBA;;EATE,IAAA;AAAA;;;;;;;iBASc,sBAAA,kBACG,aAAA,GAAgB,aAAA,CAAA,CAEjC,OAAA,EAAS,QAAA,EACT,OAAA,GAAS,6BAAA,GACR,eAAA,CAAgB,QAAA;AAAA,UA+BF,qBAAA,SAA8B,6BAAA;EAnC5B;;;;;EAyCjB,kBAAA;AAAA;;;;AANF;;;iBAegB,cAAA,kBAAgC,aAAA,GAAgB,aAAA,CAAA,CAC9D,OAAA,EAAS,QAAA,EACT,OAAA,GAAS,qBAAA,GACR,eAAA,CAAgB,QAAA;AAAA"}
@@ -21,7 +21,14 @@ interface CreateUnpluginResolverOptions extends CreateUnpluginModuleResolutionFu
21
21
  * @returns The unplugin instance.
22
22
  */
23
23
  declare function createUnpluginResolver<TContext extends PluginContext = PluginContext>(context: TContext, options?: CreateUnpluginResolverOptions): UnpluginFactory<TContext>;
24
- interface CreateUnpluginOptions extends CreateUnpluginResolverOptions {}
24
+ interface CreateUnpluginOptions extends CreateUnpluginResolverOptions {
25
+ /**
26
+ * Whether to silence logging for the plugin hooks. This can be useful for plugins that run frequently or have hooks that are called often, to reduce noise in the logs. When set to `true`, the plugin will not log any messages for its hooks. When set to `false` (the default), the plugin will log messages for its hooks as normal.
27
+ *
28
+ * @defaultValue false
29
+ */
30
+ silenceHookLogging?: boolean;
31
+ }
25
32
  /**
26
33
  * Creates a Powerlines unplugin instance.
27
34
  *
@@ -1 +1 @@
1
- {"version":3,"file":"plugin.d.mts","names":[],"sources":["../../../src/lib/unplugin/plugin.ts"],"mappings":";;;;;UAsCiB,6BAAA,SAAsC,8CAAA;;AAAvD;;;;;AAkBA;;EATE,IAAA;AAAA;;;;;;;iBASc,sBAAA,kBACG,aAAA,GAAgB,aAAA,CAAA,CAEjC,OAAA,EAAS,QAAA,EACT,OAAA,GAAS,6BAAA,GACR,eAAA,CAAgB,QAAA;AAAA,UA+BF,qBAAA,SAA8B,6BAAA;;;;;;;iBAQ/B,cAAA,kBAAgC,aAAA,GAAgB,aAAA,CAAA,CAC9D,OAAA,EAAS,QAAA,EACT,OAAA,GAAS,qBAAA,GACR,eAAA,CAAgB,QAAA;AAAA"}
1
+ {"version":3,"file":"plugin.d.mts","names":[],"sources":["../../../src/lib/unplugin/plugin.ts"],"mappings":";;;;;UAsCiB,6BAAA,SAAsC,8CAAA;;AAAvD;;;;;AAkBA;;EATE,IAAA;AAAA;;;;;;;iBASc,sBAAA,kBACG,aAAA,GAAgB,aAAA,CAAA,CAEjC,OAAA,EAAS,QAAA,EACT,OAAA,GAAS,6BAAA,GACR,eAAA,CAAgB,QAAA;AAAA,UA+BF,qBAAA,SAA8B,6BAAA;EAnC5B;;;;;EAyCjB,kBAAA;AAAA;;;;AANF;;;iBAegB,cAAA,kBAAgC,aAAA,GAAgB,aAAA,CAAA,CAC9D,OAAA,EAAS,QAAA,EACT,OAAA,GAAS,qBAAA,GACR,eAAA,CAAgB,QAAA;AAAA"}
@@ -51,7 +51,7 @@ function createUnplugin(context, options = {}) {
51
51
  try {
52
52
  const { resolveId, load } = createUnpluginModuleResolutionFunctions(context, options);
53
53
  async function buildStart() {
54
- log(LogLevelLabel.DEBUG, "Powerlines build plugin starting...");
54
+ if (!options.silenceHookLogging) log(LogLevelLabel.DEBUG, "Powerlines build plugin starting...");
55
55
  await ctx.$$internal.callHook("buildStart", { sequential: true });
56
56
  }
57
57
  async function transform(code, id) {
@@ -63,11 +63,11 @@ function createUnplugin(context, options = {}) {
63
63
  return transformed;
64
64
  }
65
65
  async function buildEnd() {
66
- log(LogLevelLabel.DEBUG, "Powerlines build plugin finishing...");
66
+ if (!options.silenceHookLogging) log(LogLevelLabel.DEBUG, "Powerlines build plugin finishing...");
67
67
  return ctx.$$internal.callHook("buildEnd", { sequential: true });
68
68
  }
69
69
  async function writeBundle() {
70
- log(LogLevelLabel.DEBUG, "Finalizing Powerlines project output...");
70
+ if (!options.silenceHookLogging) log(LogLevelLabel.DEBUG, "Finalizing Powerlines project output...");
71
71
  return ctx.$$internal.callHook("writeBundle", { sequential: true });
72
72
  }
73
73
  return {
@@ -1 +1 @@
1
- {"version":3,"file":"plugin.mjs","names":[],"sources":["../../../src/lib/unplugin/plugin.ts"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Powerlines\n\n This code was released as part of the Powerlines project. Powerlines\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/powerlines.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/powerlines\n Documentation: https://docs.stormsoftware.com/projects/powerlines\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport { Unstable_PluginContext } from \"@powerlines/core/types/_internal\";\nimport { LogLevelLabel } from \"@storm-software/config-tools/types\";\nimport { kebabCase } from \"@stryke/string-format/kebab-case\";\nimport { titleCase } from \"@stryke/string-format/title-case\";\nimport type {\n TransformResult,\n UnpluginBuildContext,\n UnpluginContext\n} from \"unplugin\";\nimport { setParseImpl } from \"unplugin\";\nimport { PluginContext } from \"../../types/context\";\nimport { UnpluginFactory } from \"../../types/unplugin\";\nimport { extendLog } from \"../logger\";\nimport { getString } from \"../utilities/source-file\";\nimport { combineContexts } from \"./helpers\";\nimport {\n createUnpluginModuleResolutionFunctions,\n CreateUnpluginModuleResolutionFunctionsOptions\n} from \"./module-resolution\";\n\nexport interface CreateUnpluginResolverOptions extends CreateUnpluginModuleResolutionFunctionsOptions {\n /**\n * A name to use for the unplugin instance. This is used for logging and to generate the plugin name. It does not affect the functionality of the plugin.\n *\n * @remarks\n * If not provided, the plugin will be named \"powerlines\". If provided, the plugin will be named `${name} - Powerlines` (e.g., \"MyPlugin - Powerlines\").\n *\n * @defaultValue \"powerlines\"\n */\n name?: string;\n}\n\n/**\n * Creates a Powerlines unplugin instance.\n *\n * @param context - The plugin context.\n * @returns The unplugin instance.\n */\nexport function createUnpluginResolver<\n TContext extends PluginContext = PluginContext\n>(\n context: TContext,\n options: CreateUnpluginResolverOptions = {}\n): UnpluginFactory<TContext> {\n const ctx = context as unknown as Unstable_PluginContext;\n setParseImpl(ctx.parse);\n\n const name = options.name || \"powerlines\";\n\n return () => {\n const log = extendLog(ctx.log, name);\n log(LogLevelLabel.DEBUG, `Initializing ${titleCase(name)} plugin`);\n\n try {\n const { resolveId, load } =\n createUnpluginModuleResolutionFunctions<TContext>(context, options);\n\n return {\n name:\n name.toLowerCase() === \"powerlines\"\n ? \"powerlines\"\n : `powerlines:${kebabCase(name)}`,\n api: ctx.$$internal.api,\n resolveId,\n load\n };\n } catch (error) {\n log(LogLevelLabel.FATAL, (error as Error)?.message);\n\n throw error;\n }\n };\n}\n\nexport interface CreateUnpluginOptions extends CreateUnpluginResolverOptions {}\n\n/**\n * Creates a Powerlines unplugin instance.\n *\n * @param context - The plugin context.\n * @returns The unplugin instance.\n */\nexport function createUnplugin<TContext extends PluginContext = PluginContext>(\n context: TContext,\n options: CreateUnpluginOptions = {}\n): UnpluginFactory<TContext> {\n const ctx = context as unknown as Unstable_PluginContext;\n setParseImpl(ctx.parse);\n\n const name = options.name || \"powerlines\";\n\n return () => {\n const log = extendLog(ctx.log, name);\n log(LogLevelLabel.DEBUG, `Initializing ${titleCase(name)} plugin`);\n\n try {\n const { resolveId, load } =\n createUnpluginModuleResolutionFunctions<TContext>(context, options);\n\n async function buildStart(this: UnpluginBuildContext) {\n log(LogLevelLabel.DEBUG, \"Powerlines build plugin starting...\");\n\n await ctx.$$internal.callHook(\"buildStart\", {\n sequential: true\n });\n }\n\n async function transform(\n this: UnpluginBuildContext & UnpluginContext,\n code: string,\n id: string\n ): Promise<TransformResult | null | undefined> {\n let transformed: TransformResult | string = code;\n\n for (const hook of ctx.$$internal.environment.selectHooks(\n \"transform\"\n )) {\n const result: TransformResult | string | undefined =\n await hook.handler.apply(combineContexts(ctx, this), [\n getString(transformed),\n id\n ]);\n if (result) {\n transformed = result;\n }\n }\n\n return transformed;\n }\n\n async function buildEnd(this: UnpluginBuildContext): Promise<void> {\n log(LogLevelLabel.DEBUG, \"Powerlines build plugin finishing...\");\n\n return ctx.$$internal.callHook(\"buildEnd\", {\n sequential: true\n });\n }\n\n async function writeBundle(): Promise<void> {\n log(LogLevelLabel.DEBUG, \"Finalizing Powerlines project output...\");\n\n return ctx.$$internal.callHook(\"writeBundle\", {\n sequential: true\n });\n }\n\n return {\n name:\n name.toLowerCase() === \"powerlines\"\n ? \"powerlines\"\n : `powerlines:${kebabCase(name)}`,\n api: ctx.$$internal.api,\n resolveId,\n load,\n transform,\n buildStart,\n buildEnd,\n writeBundle,\n vite: {\n sharedDuringBuild: true\n }\n };\n } catch (error) {\n log(LogLevelLabel.FATAL, (error as Error)?.message);\n\n throw error;\n }\n };\n}\n"],"mappings":";;;;;;;;;;;;;;;;AAwDA,SAAgB,uBAGd,SACA,UAAyC,EAAE,EAChB;CAC3B,MAAM,MAAM;AACZ,cAAa,IAAI,MAAM;CAEvB,MAAM,OAAO,QAAQ,QAAQ;AAE7B,cAAa;EACX,MAAM,MAAM,UAAU,IAAI,KAAK,KAAK;AACpC,MAAI,cAAc,OAAO,gBAAgB,UAAU,KAAK,CAAC,SAAS;AAElE,MAAI;GACF,MAAM,EAAE,WAAW,SACjB,wCAAkD,SAAS,QAAQ;AAErE,UAAO;IACL,MACE,KAAK,aAAa,KAAK,eACnB,eACA,cAAc,UAAU,KAAK;IACnC,KAAK,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file":"plugin.mjs","names":[],"sources":["../../../src/lib/unplugin/plugin.ts"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Powerlines\n\n This code was released as part of the Powerlines project. Powerlines\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/powerlines.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/powerlines\n Documentation: https://docs.stormsoftware.com/projects/powerlines\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport { Unstable_PluginContext } from \"@powerlines/core/types/_internal\";\nimport { LogLevelLabel } from \"@storm-software/config-tools/types\";\nimport { kebabCase } from \"@stryke/string-format/kebab-case\";\nimport { titleCase } from \"@stryke/string-format/title-case\";\nimport type {\n TransformResult,\n UnpluginBuildContext,\n UnpluginContext\n} from \"unplugin\";\nimport { setParseImpl } from \"unplugin\";\nimport { PluginContext } from \"../../types/context\";\nimport { UnpluginFactory } from \"../../types/unplugin\";\nimport { extendLog } from \"../logger\";\nimport { getString } from \"../utilities/source-file\";\nimport { combineContexts } from \"./helpers\";\nimport {\n createUnpluginModuleResolutionFunctions,\n CreateUnpluginModuleResolutionFunctionsOptions\n} from \"./module-resolution\";\n\nexport interface CreateUnpluginResolverOptions extends CreateUnpluginModuleResolutionFunctionsOptions {\n /**\n * A name to use for the unplugin instance. This is used for logging and to generate the plugin name. It does not affect the functionality of the plugin.\n *\n * @remarks\n * If not provided, the plugin will be named \"powerlines\". If provided, the plugin will be named `${name} - Powerlines` (e.g., \"MyPlugin - Powerlines\").\n *\n * @defaultValue \"powerlines\"\n */\n name?: string;\n}\n\n/**\n * Creates a Powerlines unplugin instance.\n *\n * @param context - The plugin context.\n * @returns The unplugin instance.\n */\nexport function createUnpluginResolver<\n TContext extends PluginContext = PluginContext\n>(\n context: TContext,\n options: CreateUnpluginResolverOptions = {}\n): UnpluginFactory<TContext> {\n const ctx = context as unknown as Unstable_PluginContext;\n setParseImpl(ctx.parse);\n\n const name = options.name || \"powerlines\";\n\n return () => {\n const log = extendLog(ctx.log, name);\n log(LogLevelLabel.DEBUG, `Initializing ${titleCase(name)} plugin`);\n\n try {\n const { resolveId, load } =\n createUnpluginModuleResolutionFunctions<TContext>(context, options);\n\n return {\n name:\n name.toLowerCase() === \"powerlines\"\n ? \"powerlines\"\n : `powerlines:${kebabCase(name)}`,\n api: ctx.$$internal.api,\n resolveId,\n load\n };\n } catch (error) {\n log(LogLevelLabel.FATAL, (error as Error)?.message);\n\n throw error;\n }\n };\n}\n\nexport interface CreateUnpluginOptions extends CreateUnpluginResolverOptions {\n /**\n * Whether to silence logging for the plugin hooks. This can be useful for plugins that run frequently or have hooks that are called often, to reduce noise in the logs. When set to `true`, the plugin will not log any messages for its hooks. When set to `false` (the default), the plugin will log messages for its hooks as normal.\n *\n * @defaultValue false\n */\n silenceHookLogging?: boolean;\n}\n\n/**\n * Creates a Powerlines unplugin instance.\n *\n * @param context - The plugin context.\n * @returns The unplugin instance.\n */\nexport function createUnplugin<TContext extends PluginContext = PluginContext>(\n context: TContext,\n options: CreateUnpluginOptions = {}\n): UnpluginFactory<TContext> {\n const ctx = context as unknown as Unstable_PluginContext;\n setParseImpl(ctx.parse);\n\n const name = options.name || \"powerlines\";\n\n return () => {\n const log = extendLog(ctx.log, name);\n log(LogLevelLabel.DEBUG, `Initializing ${titleCase(name)} plugin`);\n\n try {\n const { resolveId, load } =\n createUnpluginModuleResolutionFunctions<TContext>(context, options);\n\n async function buildStart(this: UnpluginBuildContext) {\n if (!options.silenceHookLogging) {\n log(LogLevelLabel.DEBUG, \"Powerlines build plugin starting...\");\n }\n\n await ctx.$$internal.callHook(\"buildStart\", {\n sequential: true\n });\n }\n\n async function transform(\n this: UnpluginBuildContext & UnpluginContext,\n code: string,\n id: string\n ): Promise<TransformResult | null | undefined> {\n let transformed: TransformResult | string = code;\n\n for (const hook of ctx.$$internal.environment.selectHooks(\n \"transform\"\n )) {\n const result: TransformResult | string | undefined =\n await hook.handler.apply(combineContexts(ctx, this), [\n getString(transformed),\n id\n ]);\n if (result) {\n transformed = result;\n }\n }\n\n return transformed;\n }\n\n async function buildEnd(this: UnpluginBuildContext): Promise<void> {\n if (!options.silenceHookLogging) {\n log(LogLevelLabel.DEBUG, \"Powerlines build plugin finishing...\");\n }\n\n return ctx.$$internal.callHook(\"buildEnd\", {\n sequential: true\n });\n }\n\n async function writeBundle(): Promise<void> {\n if (!options.silenceHookLogging) {\n log(LogLevelLabel.DEBUG, \"Finalizing Powerlines project output...\");\n }\n\n return ctx.$$internal.callHook(\"writeBundle\", {\n sequential: true\n });\n }\n\n return {\n name:\n name.toLowerCase() === \"powerlines\"\n ? \"powerlines\"\n : `powerlines:${kebabCase(name)}`,\n api: ctx.$$internal.api,\n resolveId,\n load,\n transform,\n buildStart,\n buildEnd,\n writeBundle,\n vite: {\n sharedDuringBuild: true\n }\n };\n } catch (error) {\n log(LogLevelLabel.FATAL, (error as Error)?.message);\n\n throw error;\n }\n };\n}\n"],"mappings":";;;;;;;;;;;;;;;;AAwDA,SAAgB,uBAGd,SACA,UAAyC,EAAE,EAChB;CAC3B,MAAM,MAAM;AACZ,cAAa,IAAI,MAAM;CAEvB,MAAM,OAAO,QAAQ,QAAQ;AAE7B,cAAa;EACX,MAAM,MAAM,UAAU,IAAI,KAAK,KAAK;AACpC,MAAI,cAAc,OAAO,gBAAgB,UAAU,KAAK,CAAC,SAAS;AAElE,MAAI;GACF,MAAM,EAAE,WAAW,SACjB,wCAAkD,SAAS,QAAQ;AAErE,UAAO;IACL,MACE,KAAK,aAAa,KAAK,eACnB,eACA,cAAc,UAAU,KAAK;IACnC,KAAK,IAAI,WAAW;IACpB;IACA;IACD;WACM,OAAO;AACd,OAAI,cAAc,OAAQ,OAAiB,QAAQ;AAEnD,SAAM;;;;;;;;;;AAoBZ,SAAgB,eACd,SACA,UAAiC,EAAE,EACR;CAC3B,MAAM,MAAM;AACZ,cAAa,IAAI,MAAM;CAEvB,MAAM,OAAO,QAAQ,QAAQ;AAE7B,cAAa;EACX,MAAM,MAAM,UAAU,IAAI,KAAK,KAAK;AACpC,MAAI,cAAc,OAAO,gBAAgB,UAAU,KAAK,CAAC,SAAS;AAElE,MAAI;GACF,MAAM,EAAE,WAAW,SACjB,wCAAkD,SAAS,QAAQ;GAErE,eAAe,aAAuC;AACpD,QAAI,CAAC,QAAQ,mBACX,KAAI,cAAc,OAAO,sCAAsC;AAGjE,UAAM,IAAI,WAAW,SAAS,cAAc,EAC1C,YAAY,MACb,CAAC;;GAGJ,eAAe,UAEb,MACA,IAC6C;IAC7C,IAAI,cAAwC;AAE5C,SAAK,MAAM,QAAQ,IAAI,WAAW,YAAY,YAC5C,YACD,EAAE;KACD,MAAM,SACJ,MAAM,KAAK,QAAQ,MAAM,gBAAgB,KAAK,KAAK,EAAE,CACnD,UAAU,YAAY,EACtB,GACD,CAAC;AACJ,SAAI,OACF,eAAc;;AAIlB,WAAO;;GAGT,eAAe,WAAoD;AACjE,QAAI,CAAC,QAAQ,mBACX,KAAI,cAAc,OAAO,uCAAuC;AAGlE,WAAO,IAAI,WAAW,SAAS,YAAY,EACzC,YAAY,MACb,CAAC;;GAGJ,eAAe,cAA6B;AAC1C,QAAI,CAAC,QAAQ,mBACX,KAAI,cAAc,OAAO,0CAA0C;AAGrE,WAAO,IAAI,WAAW,SAAS,eAAe,EAC5C,YAAY,MACb,CAAC;;AAGJ,UAAO;IACL,MACE,KAAK,aAAa,KAAK,eACnB,eACA,cAAc,UAAU,KAAK;IACnC,KAAK,IAAI,WAAW;IACpB;IACA;IACA;IACA;IACA;IACA;IACA,MAAM,EACJ,mBAAmB,MACpB;IACF;WACM,OAAO;AACd,OAAI,cAAc,OAAQ,OAAiB,QAAQ;AAEnD,SAAM"}
@@ -13,7 +13,7 @@ let _stryke_type_checks_is_regexp = require("@stryke/type-checks/is-regexp");
13
13
  * @returns The dependency configuration.
14
14
  */
15
15
  function getDependencyConfig(context) {
16
- const noExternal = (0, _stryke_helpers_get_unique.getUnique)((0, _stryke_convert_to_array.toArray)(context.config.resolve.noExternal).concat(context.builtins));
16
+ const noExternal = (0, _stryke_helpers_get_unique.getUnique)((0, _stryke_convert_to_array.toArray)(context.config.resolve.noExternal).concat(context.builtins.map((builtin) => `${context.config.framework}:${builtin}`)));
17
17
  const external = (0, _stryke_helpers_get_unique.getUnique)((0, _stryke_convert_to_array.toArray)(context.config.resolve.external).reduce((ret, ext) => {
18
18
  if ((0, _stryke_type_checks_is_regexp.isRegExp)(ext)) {
19
19
  if (noExternal.some((noExt) => (0, _stryke_type_checks_is_regexp.isRegExp)(noExt) && noExt.source === ext.source)) return ret;
@@ -11,7 +11,7 @@ import { isRegExp } from "@stryke/type-checks/is-regexp";
11
11
  * @returns The dependency configuration.
12
12
  */
13
13
  function getDependencyConfig(context) {
14
- const noExternal = getUnique(toArray(context.config.resolve.noExternal).concat(context.builtins));
14
+ const noExternal = getUnique(toArray(context.config.resolve.noExternal).concat(context.builtins.map((builtin) => `${context.config.framework}:${builtin}`)));
15
15
  const external = getUnique(toArray(context.config.resolve.external).reduce((ret, ext) => {
16
16
  if (isRegExp(ext)) {
17
17
  if (noExternal.some((noExt) => isRegExp(noExt) && noExt.source === ext.source)) return ret;
@@ -1 +1 @@
1
- {"version":3,"file":"build-helpers.mjs","names":[],"sources":["../../src/plugin-utils/build-helpers.ts"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Powerlines\n\n This code was released as part of the Powerlines project. Powerlines\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/powerlines.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/powerlines\n Documentation: https://docs.stormsoftware.com/projects/powerlines\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport { toArray } from \"@stryke/convert/to-array\";\nimport { getUnique } from \"@stryke/helpers/get-unique\";\nimport { isRegExp } from \"@stryke/type-checks/is-regexp\";\nimport { isSetString } from \"@stryke/type-checks/is-set-string\";\nimport { ResolveConfig } from \"../types/config\";\nimport { Context } from \"../types/context\";\n\nexport interface GetDependencyConfigResult {\n external: ResolveConfig[\"external\"];\n noExternal: ResolveConfig[\"noExternal\"];\n}\n\n/**\n * Get the {@link ResolveConfig.external | external} and {@link ResolveConfig.noExternal | noExternal} dependencies for the build configuration.\n *\n * @param context - The build context.\n * @returns The dependency configuration.\n */\nexport function getDependencyConfig(\n context: Context\n): GetDependencyConfigResult {\n const noExternal = getUnique(\n toArray(context.config.resolve.noExternal).concat(context.builtins)\n );\n\n const external = getUnique(\n toArray(context.config.resolve.external).reduce(\n (ret, ext) => {\n if (isRegExp(ext)) {\n if (\n noExternal.some(\n noExt => isRegExp(noExt) && noExt.source === ext.source\n )\n ) {\n return ret;\n }\n\n const noExts = noExternal.filter(\n noExt => isSetString(noExt) && ext.test(noExt)\n );\n if (noExts.length > 0) {\n ret.push(\n new RegExp(\n noExts.reduce(\n (regex: string, noExt: string | RegExp) =>\n `(?!${\n isRegExp(noExt) ? noExt.source : `^${noExt}$`\n })${regex}`,\n `${ext.source\n .replace(/^\\^@\\?/, \"^@\")\n .replace(/^@\\?/, \"@\")\n .replace(/\\$$/, \"\")\n .replace(/\\.\\*$/, \"\")}.*$`\n )\n )\n );\n return ret;\n }\n }\n\n ret.push(ext);\n return ret;\n },\n [] as (string | RegExp)[]\n )\n );\n\n return {\n external: external.length === 0 ? undefined : external,\n noExternal: noExternal.length === 0 ? undefined : noExternal\n };\n}\n"],"mappings":";;;;;;;;;;;;AAoCA,SAAgB,oBACd,SAC2B;CAC3B,MAAM,aAAa,UACjB,QAAQ,QAAQ,OAAO,QAAQ,WAAW,CAAC,OAAO,QAAQ,SAAS,CACpE;CAED,MAAM,WAAW,UACf,QAAQ,QAAQ,OAAO,QAAQ,SAAS,CAAC,QACtC,KAAK,QAAQ;AACZ,MAAI,SAAS,IAAI,EAAE;AACjB,OACE,WAAW,MACT,UAAS,SAAS,MAAM,IAAI,MAAM,WAAW,IAAI,OAClD,CAED,QAAO;GAGT,MAAM,SAAS,WAAW,QACxB,UAAS,YAAY,MAAM,IAAI,IAAI,KAAK,MAAM,CAC/C;AACD,OAAI,OAAO,SAAS,GAAG;AACrB,QAAI,KACF,IAAI,OACF,OAAO,QACJ,OAAe,UACd,MACE,SAAS,MAAM,GAAG,MAAM,SAAS,IAAI,MAAM,GAC5C,GAAG,SACN,GAAG,IAAI,OACJ,QAAQ,UAAU,KAAK,CACvB,QAAQ,QAAQ,IAAI,CACpB,QAAQ,OAAO,GAAG,CAClB,QAAQ,SAAS,GAAG,CAAC,KACzB,CACF,CACF;AACD,WAAO;;;AAIX,MAAI,KAAK,IAAI;AACb,SAAO;IAET,EAAE,CACH,CACF;AAED,QAAO;EACL,UAAU,SAAS,WAAW,IAAI,SAAY;EAC9C,YAAY,WAAW,WAAW,IAAI,SAAY;EACnD"}
1
+ {"version":3,"file":"build-helpers.mjs","names":[],"sources":["../../src/plugin-utils/build-helpers.ts"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Powerlines\n\n This code was released as part of the Powerlines project. Powerlines\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/powerlines.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/powerlines\n Documentation: https://docs.stormsoftware.com/projects/powerlines\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport { toArray } from \"@stryke/convert/to-array\";\nimport { getUnique } from \"@stryke/helpers/get-unique\";\nimport { isRegExp } from \"@stryke/type-checks/is-regexp\";\nimport { isSetString } from \"@stryke/type-checks/is-set-string\";\nimport { ResolveConfig } from \"../types/config\";\nimport { Context } from \"../types/context\";\n\nexport interface GetDependencyConfigResult {\n external: ResolveConfig[\"external\"];\n noExternal: ResolveConfig[\"noExternal\"];\n}\n\n/**\n * Get the {@link ResolveConfig.external | external} and {@link ResolveConfig.noExternal | noExternal} dependencies for the build configuration.\n *\n * @param context - The build context.\n * @returns The dependency configuration.\n */\nexport function getDependencyConfig(\n context: Context\n): GetDependencyConfigResult {\n const noExternal = getUnique(\n toArray(context.config.resolve.noExternal).concat(\n context.builtins.map(builtin => `${context.config.framework}:${builtin}`)\n )\n );\n\n const external = getUnique(\n toArray(context.config.resolve.external).reduce(\n (ret, ext) => {\n if (isRegExp(ext)) {\n if (\n noExternal.some(\n noExt => isRegExp(noExt) && noExt.source === ext.source\n )\n ) {\n return ret;\n }\n\n const noExts = noExternal.filter(\n noExt => isSetString(noExt) && ext.test(noExt)\n );\n if (noExts.length > 0) {\n ret.push(\n new RegExp(\n noExts.reduce(\n (regex: string, noExt: string | RegExp) =>\n `(?!${\n isRegExp(noExt) ? noExt.source : `^${noExt}$`\n })${regex}`,\n `${ext.source\n .replace(/^\\^@\\?/, \"^@\")\n .replace(/^@\\?/, \"@\")\n .replace(/\\$$/, \"\")\n .replace(/\\.\\*$/, \"\")}.*$`\n )\n )\n );\n return ret;\n }\n }\n\n ret.push(ext);\n return ret;\n },\n [] as (string | RegExp)[]\n )\n );\n\n return {\n external: external.length === 0 ? undefined : external,\n noExternal: noExternal.length === 0 ? undefined : noExternal\n };\n}\n"],"mappings":";;;;;;;;;;;;AAoCA,SAAgB,oBACd,SAC2B;CAC3B,MAAM,aAAa,UACjB,QAAQ,QAAQ,OAAO,QAAQ,WAAW,CAAC,OACzC,QAAQ,SAAS,KAAI,YAAW,GAAG,QAAQ,OAAO,UAAU,GAAG,UAAU,CAC1E,CACF;CAED,MAAM,WAAW,UACf,QAAQ,QAAQ,OAAO,QAAQ,SAAS,CAAC,QACtC,KAAK,QAAQ;AACZ,MAAI,SAAS,IAAI,EAAE;AACjB,OACE,WAAW,MACT,UAAS,SAAS,MAAM,IAAI,MAAM,WAAW,IAAI,OAClD,CAED,QAAO;GAGT,MAAM,SAAS,WAAW,QACxB,UAAS,YAAY,MAAM,IAAI,IAAI,KAAK,MAAM,CAC/C;AACD,OAAI,OAAO,SAAS,GAAG;AACrB,QAAI,KACF,IAAI,OACF,OAAO,QACJ,OAAe,UACd,MACE,SAAS,MAAM,GAAG,MAAM,SAAS,IAAI,MAAM,GAC5C,GAAG,SACN,GAAG,IAAI,OACJ,QAAQ,UAAU,KAAK,CACvB,QAAQ,QAAQ,IAAI,CACpB,QAAQ,OAAO,GAAG,CAClB,QAAQ,SAAS,GAAG,CAAC,KACzB,CACF,CACF;AACD,WAAO;;;AAIX,MAAI,KAAK,IAAI;AACb,SAAO;IAET,EAAE,CACH,CACF;AAED,QAAO;EACL,UAAU,SAAS,WAAW,IAAI,SAAY;EAC9C,YAAY,WAAW,WAAW,IAAI,SAAY;EACnD"}
@@ -126,8 +126,20 @@ function isUnpluginHookField(field) {
126
126
  * @param plugins - The list of plugins to check against
127
127
  * @returns True if the plugin should be deduplicated, false otherwise
128
128
  */
129
- function checkDedupe(plugin, plugins) {
130
- return plugin.dedupe === false || plugins.some((p) => p.dedupe !== false && ((0, _stryke_type_checks_is_function.isFunction)(p.dedupe) && p.dedupe(plugin) || p.name === plugin.name));
129
+ function isDuplicate(plugin, plugins) {
130
+ return plugin.dedupe !== false && plugins.some((p) => p.dedupe !== false && ((0, _stryke_type_checks_is_function.isFunction)(p.dedupe) && p.dedupe(plugin) || p.name.toLowerCase() === plugin.name.toLowerCase()));
131
+ }
132
+ /**
133
+ * Remove duplicate hooks from a list of hooks, keeping the first occurrence of each plugin.
134
+ *
135
+ * @param hooksList - The list of hooks to deduplicate.
136
+ * @returns A new list of hooks with duplicates removed.
137
+ */
138
+ function dedupeHooklist(hooksList) {
139
+ return hooksList.reduce((ret, hook) => {
140
+ if (!isDuplicate(hook.plugin, ret.map((h) => h.plugin))) ret.push(hook);
141
+ return ret;
142
+ }, []);
131
143
  }
132
144
  /**
133
145
  * Add a plugin hook to the hooks list.
@@ -138,14 +150,15 @@ function checkDedupe(plugin, plugins) {
138
150
  * @param hooksList - The list of hooks to add to
139
151
  */
140
152
  function addPluginHook(context, plugin, pluginHook, hooksList) {
141
- if (!checkDedupe(plugin, hooksList.map((hook) => hook.plugin).filter(Boolean))) {
153
+ if (!isDuplicate(plugin, hooksList.map((hook) => hook.plugin).filter(Boolean))) {
142
154
  const handler = ((...args) => getHookHandler(pluginHook).apply(context, args));
143
- if (!handler) return;
155
+ if (!handler) return dedupeHooklist(hooksList);
144
156
  hooksList.push({
145
157
  plugin,
146
158
  handler
147
159
  });
148
160
  }
161
+ return dedupeHooklist(hooksList);
149
162
  }
150
163
  /**
151
164
  * Check the provided {@link PluginConfig}, and return a stringified version of the invalid configuration. If an array is provided, check each item in the array.
@@ -168,10 +181,11 @@ function findInvalidPluginConfig(config) {
168
181
 
169
182
  //#endregion
170
183
  exports.addPluginHook = addPluginHook;
171
- exports.checkDedupe = checkDedupe;
184
+ exports.dedupeHooklist = dedupeHooklist;
172
185
  exports.extractPluginHook = extractPluginHook;
173
186
  exports.findInvalidPluginConfig = findInvalidPluginConfig;
174
187
  exports.getHookHandler = getHookHandler;
188
+ exports.isDuplicate = isDuplicate;
175
189
  exports.isPlugin = isPlugin;
176
190
  exports.isPluginConfig = isPluginConfig;
177
191
  exports.isPluginConfigObject = isPluginConfigObject;
@@ -85,11 +85,11 @@ declare function extractPluginHook<TContext extends PluginContext = PluginContex
85
85
  isEntry: boolean;
86
86
  }) => _$_stryke_types_base0.MaybePromise<string | ResolveResult | null | undefined>, never> & ((this: _$unplugin.UnpluginBuildContext & PluginContext<TContext["config"]> & TContext, id: string, importer: string | undefined, options: {
87
87
  isEntry: boolean;
88
- }) => _$_stryke_types_base0.MaybePromise<string | ResolveResult | null | undefined>)) | (((this: UnresolvedContext<TContext["config"]>) => _$_stryke_types_base0.MaybePromise<(TContext["config"] extends infer T ? { [K in keyof T]?: (T[K] extends infer T_1 ? { [K_2 in keyof T_1]?: (T_1[K_2] extends infer T_2 ? { [K_3 in keyof T_2]?: (T_2[K_3] extends infer T_3 ? { [K_4 in keyof T_3]?: (T_3[K_4] extends infer T_4 ? { [K_5 in keyof T_4]?: (T_4[K_5] extends infer T_5 ? { [K_6 in keyof T_5]?: (T_5[K_6] extends infer T_6 ? { [K_7 in keyof T_6]?: (T_6[K_7] extends infer T_7 ? { [K_8 in keyof T_7]?: (T_7[K_8] extends infer T_8 ? { [K_9 in keyof T_8]?: (T_8[K_9] extends infer T_9 ? { [K_10 in keyof T_9]?: (T_9[K_10] extends infer T_10 ? { [K_11 in keyof T_10]?: /*elided*/any | undefined } : never) | undefined } : never) | undefined } : never) | undefined } : never) | undefined } : never) | undefined } : never) | undefined } : never) | undefined } : never) | undefined } : never) | undefined } : never) | undefined } : never) & Record<string, any>>) & ((this: UnresolvedContext<TContext["config"]>) => _$_stryke_types_base0.MaybePromise<(TContext["config"] extends infer T ? { [K in keyof T]?: (T[K] extends infer T_1 ? { [K_2 in keyof T_1]?: (T_1[K_2] extends infer T_2 ? { [K_3 in keyof T_2]?: (T_2[K_3] extends infer T_3 ? { [K_4 in keyof T_3]?: (T_3[K_4] extends infer T_4 ? { [K_5 in keyof T_4]?: (T_4[K_5] extends infer T_5 ? { [K_6 in keyof T_5]?: (T_5[K_6] extends infer T_6 ? { [K_7 in keyof T_6]?: (T_6[K_7] extends infer T_7 ? { [K_8 in keyof T_7]?: (T_7[K_8] extends infer T_8 ? { [K_9 in keyof T_8]?: (T_8[K_9] extends infer T_9 ? { [K_10 in keyof T_9]?: (T_9[K_10] extends infer T_10 ? { [K_11 in keyof T_10]?: /*elided*/any | undefined } : never) | undefined } : never) | undefined } : never) | undefined } : never) | undefined } : never) | undefined } : never) | undefined } : never) | undefined } : never) | undefined } : never) | undefined } : never) | undefined } : never) & Record<string, any>>)) | (((this: UnresolvedContext<TContext["config"]>) => _$_stryke_types_base0.MaybePromise<(TContext["config"] extends infer T ? { [K in keyof T]?: (T[K] extends infer T_1 ? { [K_2 in keyof T_1]?: (T_1[K_2] extends infer T_2 ? { [K_3 in keyof T_2]?: (T_2[K_3] extends infer T_3 ? { [K_4 in keyof T_3]?: (T_3[K_4] extends infer T_4 ? { [K_5 in keyof T_4]?: (T_4[K_5] extends infer T_5 ? { [K_6 in keyof T_5]?: (T_5[K_6] extends infer T_6 ? { [K_7 in keyof T_6]?: (T_6[K_7] extends infer T_7 ? { [K_8 in keyof T_7]?: (T_7[K_8] extends infer T_8 ? { [K_9 in keyof T_8]?: (T_8[K_9] extends infer T_9 ? { [K_10 in keyof T_9]?: (T_9[K_10] extends infer T_10 ? { [K_11 in keyof T_10]?: /*elided*/any | undefined } : never) | undefined } : never) | undefined } : never) | undefined } : never) | undefined } : never) | undefined } : never) | undefined } : never) | undefined } : never) | undefined } : never) | undefined } : never) | undefined } : never) & Record<string, any>>) & PluginHookObject<(this: UnresolvedContext<TContext["config"]>) => _$_stryke_types_base0.MaybePromise<(TContext["config"] extends infer T ? { [K in keyof T]?: (T[K] extends infer T_1 ? { [K_2 in keyof T_1]?: (T_1[K_2] extends infer T_2 ? { [K_3 in keyof T_2]?: (T_2[K_3] extends infer T_3 ? { [K_4 in keyof T_3]?: (T_3[K_4] extends infer T_4 ? { [K_5 in keyof T_4]?: (T_4[K_5] extends infer T_5 ? { [K_6 in keyof T_5]?: (T_5[K_6] extends infer T_6 ? { [K_7 in keyof T_6]?: (T_6[K_7] extends infer T_7 ? { [K_8 in keyof T_7]?: (T_7[K_8] extends infer T_8 ? { [K_9 in keyof T_8]?: (T_8[K_9] extends infer T_9 ? { [K_10 in keyof T_9]?: (T_9[K_10] extends infer T_10 ? { [K_11 in keyof T_10]?: /*elided*/any | undefined } : never) | undefined } : never) | undefined } : never) | undefined } : never) | undefined } : never) | undefined } : never) | undefined } : never) | undefined } : never) | undefined } : never) | undefined } : never) | undefined } : never) & Record<string, any>>, never>) | (((this: UnresolvedContext<TContext["config"]>) => _$_stryke_types_base0.MaybePromise<(TContext["config"] extends infer T ? { [K in keyof T]?: (T[K] extends infer T_1 ? { [K_2 in keyof T_1]?: (T_1[K_2] extends infer T_2 ? { [K_3 in keyof T_2]?: (T_2[K_3] extends infer T_3 ? { [K_4 in keyof T_3]?: (T_3[K_4] extends infer T_4 ? { [K_5 in keyof T_4]?: (T_4[K_5] extends infer T_5 ? { [K_6 in keyof T_5]?: (T_5[K_6] extends infer T_6 ? { [K_7 in keyof T_6]?: (T_6[K_7] extends infer T_7 ? { [K_8 in keyof T_7]?: (T_7[K_8] extends infer T_8 ? { [K_9 in keyof T_8]?: (T_8[K_9] extends infer T_9 ? { [K_10 in keyof T_9]?: (T_9[K_10] extends infer T_10 ? { [K_11 in keyof T_10]?: /*elided*/any | undefined } : never) | undefined } : never) | undefined } : never) | undefined } : never) | undefined } : never) | undefined } : never) | undefined } : never) | undefined } : never) | undefined } : never) | undefined } : never) | undefined } : never) & Record<string, any>>) & (TContext["config"] extends infer T ? { [K in keyof T]?: (T[K] extends infer T_1 ? { [K_2 in keyof T_1]?: (T_1[K_2] extends infer T_2 ? { [K_3 in keyof T_2]?: (T_2[K_3] extends infer T_3 ? { [K_4 in keyof T_3]?: (T_3[K_4] extends infer T_4 ? { [K_5 in keyof T_4]?: (T_4[K_5] extends infer T_5 ? { [K_6 in keyof T_5]?: (T_5[K_6] extends infer T_6 ? { [K_7 in keyof T_6]?: (T_6[K_7] extends infer T_7 ? { [K_8 in keyof T_7]?: (T_7[K_8] extends infer T_8 ? { [K_9 in keyof T_8]?: (T_8[K_9] extends infer T_9 ? { [K_10 in keyof T_9]?: (T_9[K_10] extends infer T_10 ? { [K_11 in keyof T_10]?: /*elided*/any | undefined } : never) | undefined } : never) | undefined } : never) | undefined } : never) | undefined } : never) | undefined } : never) | undefined } : never) | undefined } : never) | undefined } : never) | undefined } : never) | undefined } : never) & Record<string, any>) | (PluginHookObject<(this: UnresolvedContext<TContext["config"]>) => _$_stryke_types_base0.MaybePromise<(TContext["config"] extends infer T_1 ? { [K in keyof T_1]?: (T_1[K] extends infer T_2 ? { [K_2 in keyof T_2]?: (T_2[K_2] extends infer T_3 ? { [K_3 in keyof T_3]?: (T_3[K_3] extends infer T_4 ? { [K_4 in keyof T_4]?: (T_4[K_4] extends infer T_5 ? { [K_5 in keyof T_5]?: (T_5[K_5] extends infer T_6 ? { [K_6 in keyof T_6]?: (T_6[K_6] extends infer T_7 ? { [K_7 in keyof T_7]?: (T_7[K_7] extends infer T_8 ? { [K_8 in keyof T_8]?: (T_8[K_8] extends infer T_9 ? { [K_9 in keyof T_9]?: (T_9[K_9] extends infer T_10 ? { [K_10 in keyof T_10]?: (T_10[K_10] extends infer T_11 ? { [K_11 in keyof T_11]?: /*elided*/any | undefined } : never) | undefined } : never) | undefined } : never) | undefined } : never) | undefined } : never) | undefined } : never) | undefined } : never) | undefined } : never) | undefined } : never) | undefined } : never) | undefined } : never) & Record<string, any>>, never> & ((this: UnresolvedContext<TContext["config"]>) => _$_stryke_types_base0.MaybePromise<(TContext["config"] extends infer T_1 ? { [K in keyof T_1]?: (T_1[K] extends infer T_2 ? { [K_2 in keyof T_2]?: (T_2[K_2] extends infer T_3 ? { [K_3 in keyof T_3]?: (T_3[K_3] extends infer T_4 ? { [K_4 in keyof T_4]?: (T_4[K_4] extends infer T_5 ? { [K_5 in keyof T_5]?: (T_5[K_5] extends infer T_6 ? { [K_6 in keyof T_6]?: (T_6[K_6] extends infer T_7 ? { [K_7 in keyof T_7]?: (T_7[K_7] extends infer T_8 ? { [K_8 in keyof T_8]?: (T_8[K_8] extends infer T_9 ? { [K_9 in keyof T_9]?: (T_9[K_9] extends infer T_10 ? { [K_10 in keyof T_10]?: (T_10[K_10] extends infer T_11 ? { [K_11 in keyof T_11]?: /*elided*/any | undefined } : never) | undefined } : never) | undefined } : never) | undefined } : never) | undefined } : never) | undefined } : never) | undefined } : never) | undefined } : never) | undefined } : never) | undefined } : never) | undefined } : never) & Record<string, any>>)) | ((this: TContext, code: string) => _$_stryke_types_base0.MaybePromise<TypesResult | string | undefined | null>) | ((this: TContext) => _$_stryke_types_base0.MaybePromise<void>) | ((this: TContext, name: string, environment: EnvironmentConfig) => _$_stryke_types_base0.MaybePromise<Partial<EnvironmentResolvedConfig> | undefined | null>) | ((this: TContext) => _$_stryke_types_base0.MaybePromise<void>) | ((this: _$unplugin.UnpluginBuildContext & PluginContext<TContext["config"]> & TContext) => _$_stryke_types_base0.MaybePromise<void>) | ((this: _$unplugin.UnpluginBuildContext & PluginContext<TContext["config"]> & TContext) => _$_stryke_types_base0.MaybePromise<void>) | ((this: TContext) => _$_stryke_types_base0.MaybePromise<void>)>;
88
+ }) => _$_stryke_types_base0.MaybePromise<string | ResolveResult | null | undefined>)) | (((this: UnresolvedContext<TContext["config"]>) => _$_stryke_types_base0.MaybePromise<(TContext["config"] extends infer T ? { [K in keyof T]?: (T[K] extends infer T_1 ? { [K_2 in keyof T_1]?: (T_1[K_2] extends infer T_2 ? { [K_3 in keyof T_2]?: (T_2[K_3] extends infer T_3 ? { [K_4 in keyof T_3]?: (T_3[K_4] extends infer T_4 ? { [K_5 in keyof T_4]?: (T_4[K_5] extends infer T_5 ? { [K_6 in keyof T_5]?: (T_5[K_6] extends infer T_6 ? { [K_7 in keyof T_6]?: (T_6[K_7] extends infer T_7 ? { [K_8 in keyof T_7]?: (T_7[K_8] extends infer T_8 ? { [K_9 in keyof T_8]?: (T_8[K_9] extends infer T_9 ? { [K_10 in keyof T_9]?: (T_9[K_10] extends infer T_10 ? { [K_11 in keyof T_10]?: /*elided*/any | undefined } : never) | undefined } : never) | undefined } : never) | undefined } : never) | undefined } : never) | undefined } : never) | undefined } : never) | undefined } : never) | undefined } : never) | undefined } : never) | undefined } : never) & Record<string, any>>) & ((this: UnresolvedContext<TContext["config"]>) => _$_stryke_types_base0.MaybePromise<(TContext["config"] extends infer T ? { [K in keyof T]?: (T[K] extends infer T_1 ? { [K_2 in keyof T_1]?: (T_1[K_2] extends infer T_2 ? { [K_3 in keyof T_2]?: (T_2[K_3] extends infer T_3 ? { [K_4 in keyof T_3]?: (T_3[K_4] extends infer T_4 ? { [K_5 in keyof T_4]?: (T_4[K_5] extends infer T_5 ? { [K_6 in keyof T_5]?: (T_5[K_6] extends infer T_6 ? { [K_7 in keyof T_6]?: (T_6[K_7] extends infer T_7 ? { [K_8 in keyof T_7]?: (T_7[K_8] extends infer T_8 ? { [K_9 in keyof T_8]?: (T_8[K_9] extends infer T_9 ? { [K_10 in keyof T_9]?: (T_9[K_10] extends infer T_10 ? { [K_11 in keyof T_10]?: /*elided*/any | undefined } : never) | undefined } : never) | undefined } : never) | undefined } : never) | undefined } : never) | undefined } : never) | undefined } : never) | undefined } : never) | undefined } : never) | undefined } : never) | undefined } : never) & Record<string, any>>)) | (((this: UnresolvedContext<TContext["config"]>) => _$_stryke_types_base0.MaybePromise<(TContext["config"] extends infer T ? { [K in keyof T]?: (T[K] extends infer T_1 ? { [K_2 in keyof T_1]?: (T_1[K_2] extends infer T_2 ? { [K_3 in keyof T_2]?: (T_2[K_3] extends infer T_3 ? { [K_4 in keyof T_3]?: (T_3[K_4] extends infer T_4 ? { [K_5 in keyof T_4]?: (T_4[K_5] extends infer T_5 ? { [K_6 in keyof T_5]?: (T_5[K_6] extends infer T_6 ? { [K_7 in keyof T_6]?: (T_6[K_7] extends infer T_7 ? { [K_8 in keyof T_7]?: (T_7[K_8] extends infer T_8 ? { [K_9 in keyof T_8]?: (T_8[K_9] extends infer T_9 ? { [K_10 in keyof T_9]?: (T_9[K_10] extends infer T_10 ? { [K_11 in keyof T_10]?: /*elided*/any | undefined } : never) | undefined } : never) | undefined } : never) | undefined } : never) | undefined } : never) | undefined } : never) | undefined } : never) | undefined } : never) | undefined } : never) | undefined } : never) | undefined } : never) & Record<string, any>>) & PluginHookObject<(this: UnresolvedContext<TContext["config"]>) => _$_stryke_types_base0.MaybePromise<(TContext["config"] extends infer T ? { [K in keyof T]?: (T[K] extends infer T_1 ? { [K_2 in keyof T_1]?: (T_1[K_2] extends infer T_2 ? { [K_3 in keyof T_2]?: (T_2[K_3] extends infer T_3 ? { [K_4 in keyof T_3]?: (T_3[K_4] extends infer T_4 ? { [K_5 in keyof T_4]?: (T_4[K_5] extends infer T_5 ? { [K_6 in keyof T_5]?: (T_5[K_6] extends infer T_6 ? { [K_7 in keyof T_6]?: (T_6[K_7] extends infer T_7 ? { [K_8 in keyof T_7]?: (T_7[K_8] extends infer T_8 ? { [K_9 in keyof T_8]?: (T_8[K_9] extends infer T_9 ? { [K_10 in keyof T_9]?: (T_9[K_10] extends infer T_10 ? { [K_11 in keyof T_10]?: /*elided*/any | undefined } : never) | undefined } : never) | undefined } : never) | undefined } : never) | undefined } : never) | undefined } : never) | undefined } : never) | undefined } : never) | undefined } : never) | undefined } : never) | undefined } : never) & Record<string, any>>, never>) | (((this: UnresolvedContext<TContext["config"]>) => _$_stryke_types_base0.MaybePromise<(TContext["config"] extends infer T ? { [K in keyof T]?: (T[K] extends infer T_1 ? { [K_2 in keyof T_1]?: (T_1[K_2] extends infer T_2 ? { [K_3 in keyof T_2]?: (T_2[K_3] extends infer T_3 ? { [K_4 in keyof T_3]?: (T_3[K_4] extends infer T_4 ? { [K_5 in keyof T_4]?: (T_4[K_5] extends infer T_5 ? { [K_6 in keyof T_5]?: (T_5[K_6] extends infer T_6 ? { [K_7 in keyof T_6]?: (T_6[K_7] extends infer T_7 ? { [K_8 in keyof T_7]?: (T_7[K_8] extends infer T_8 ? { [K_9 in keyof T_8]?: (T_8[K_9] extends infer T_9 ? { [K_10 in keyof T_9]?: (T_9[K_10] extends infer T_10 ? { [K_11 in keyof T_10]?: /*elided*/any | undefined } : never) | undefined } : never) | undefined } : never) | undefined } : never) | undefined } : never) | undefined } : never) | undefined } : never) | undefined } : never) | undefined } : never) | undefined } : never) | undefined } : never) & Record<string, any>>) & (TContext["config"] extends infer T ? { [K in keyof T]?: (T[K] extends infer T_1 ? { [K_2 in keyof T_1]?: (T_1[K_2] extends infer T_2 ? { [K_3 in keyof T_2]?: (T_2[K_3] extends infer T_3 ? { [K_4 in keyof T_3]?: (T_3[K_4] extends infer T_4 ? { [K_5 in keyof T_4]?: (T_4[K_5] extends infer T_5 ? { [K_6 in keyof T_5]?: (T_5[K_6] extends infer T_6 ? { [K_7 in keyof T_6]?: (T_6[K_7] extends infer T_7 ? { [K_8 in keyof T_7]?: (T_7[K_8] extends infer T_8 ? { [K_9 in keyof T_8]?: (T_8[K_9] extends infer T_9 ? { [K_10 in keyof T_9]?: (T_9[K_10] extends infer T_10 ? { [K_11 in keyof T_10]?: /*elided*/any | undefined } : never) | undefined } : never) | undefined } : never) | undefined } : never) | undefined } : never) | undefined } : never) | undefined } : never) | undefined } : never) | undefined } : never) | undefined } : never) | undefined } : never) & Record<string, any>) | (PluginHookObject<(this: UnresolvedContext<TContext["config"]>) => _$_stryke_types_base0.MaybePromise<(TContext["config"] extends infer T_1 ? { [K in keyof T_1]?: (T_1[K] extends infer T_2 ? { [K_2 in keyof T_2]?: (T_2[K_2] extends infer T_3 ? { [K_3 in keyof T_3]?: (T_3[K_3] extends infer T_4 ? { [K_4 in keyof T_4]?: (T_4[K_4] extends infer T_5 ? { [K_5 in keyof T_5]?: (T_5[K_5] extends infer T_6 ? { [K_6 in keyof T_6]?: (T_6[K_6] extends infer T_7 ? { [K_7 in keyof T_7]?: (T_7[K_7] extends infer T_8 ? { [K_8 in keyof T_8]?: (T_8[K_8] extends infer T_9 ? { [K_9 in keyof T_9]?: (T_9[K_9] extends infer T_10 ? { [K_10 in keyof T_10]?: (T_10[K_10] extends infer T_11 ? { [K_11 in keyof T_11]?: /*elided*/any | undefined } : never) | undefined } : never) | undefined } : never) | undefined } : never) | undefined } : never) | undefined } : never) | undefined } : never) | undefined } : never) | undefined } : never) | undefined } : never) | undefined } : never) & Record<string, any>>, never> & ((this: UnresolvedContext<TContext["config"]>) => _$_stryke_types_base0.MaybePromise<(TContext["config"] extends infer T_1 ? { [K in keyof T_1]?: (T_1[K] extends infer T_2 ? { [K_2 in keyof T_2]?: (T_2[K_2] extends infer T_3 ? { [K_3 in keyof T_3]?: (T_3[K_3] extends infer T_4 ? { [K_4 in keyof T_4]?: (T_4[K_4] extends infer T_5 ? { [K_5 in keyof T_5]?: (T_5[K_5] extends infer T_6 ? { [K_6 in keyof T_6]?: (T_6[K_6] extends infer T_7 ? { [K_7 in keyof T_7]?: (T_7[K_7] extends infer T_8 ? { [K_8 in keyof T_8]?: (T_8[K_8] extends infer T_9 ? { [K_9 in keyof T_9]?: (T_9[K_9] extends infer T_10 ? { [K_10 in keyof T_10]?: (T_10[K_10] extends infer T_11 ? { [K_11 in keyof T_11]?: /*elided*/any | undefined } : never) | undefined } : never) | undefined } : never) | undefined } : never) | undefined } : never) | undefined } : never) | undefined } : never) | undefined } : never) | undefined } : never) | undefined } : never) | undefined } : never) & Record<string, any>>)) | ((this: TContext) => _$_stryke_types_base0.MaybePromise<void>) | ((this: TContext, name: string, environment: EnvironmentConfig) => _$_stryke_types_base0.MaybePromise<Partial<EnvironmentResolvedConfig> | undefined | null>) | ((this: TContext) => _$_stryke_types_base0.MaybePromise<void>) | ((this: TContext, code: string) => _$_stryke_types_base0.MaybePromise<TypesResult | string | undefined | null>) | ((this: _$unplugin.UnpluginBuildContext & PluginContext<TContext["config"]> & TContext) => _$_stryke_types_base0.MaybePromise<void>) | ((this: _$unplugin.UnpluginBuildContext & PluginContext<TContext["config"]> & TContext) => _$_stryke_types_base0.MaybePromise<void>) | ((this: TContext) => _$_stryke_types_base0.MaybePromise<void>)>;
89
89
  } | {
90
90
  [x: string]: OmitThisParameter<((this: _$unplugin.UnpluginBuildContext & PluginContext<TContext["config"]> & TContext, code: string, id: string) => _$_stryke_types_base0.MaybePromise<_$unplugin.TransformResult>) | ((this: _$unplugin.UnpluginBuildContext & PluginContext<TContext["config"]> & TContext, id: string) => _$_stryke_types_base0.MaybePromise<_$rollup.LoadResult>) | ((this: _$unplugin.UnpluginBuildContext & PluginContext<TContext["config"]> & TContext, id: string, importer: string | undefined, options: {
91
91
  isEntry: boolean;
92
- }) => _$_stryke_types_base0.MaybePromise<string | ResolveResult | null | undefined>) | ((this: UnresolvedContext<TContext["config"]>) => _$_stryke_types_base0.MaybePromise<(TContext["config"] extends infer T_1 ? { [K in keyof T_1]?: (T_1[K] extends infer T_2 ? { [K_2 in keyof T_2]?: (T_2[K_2] extends infer T_3 ? { [K_3 in keyof T_3]?: (T_3[K_3] extends infer T_4 ? { [K_4 in keyof T_4]?: (T_4[K_4] extends infer T_5 ? { [K_5 in keyof T_5]?: (T_5[K_5] extends infer T_6 ? { [K_6 in keyof T_6]?: (T_6[K_6] extends infer T_7 ? { [K_7 in keyof T_7]?: (T_7[K_7] extends infer T_8 ? { [K_8 in keyof T_8]?: (T_8[K_8] extends infer T_9 ? { [K_9 in keyof T_9]?: (T_9[K_9] extends infer T_10 ? { [K_10 in keyof T_10]?: (T_10[K_10] extends infer T_11 ? { [K_11 in keyof T_11]?: /*elided*/any | undefined } : never) | undefined } : never) | undefined } : never) | undefined } : never) | undefined } : never) | undefined } : never) | undefined } : never) | undefined } : never) | undefined } : never) | undefined } : never) | undefined } : never) & Record<string, any>>) | (((this: UnresolvedContext<TContext["config"]>) => _$_stryke_types_base0.MaybePromise<(TContext["config"] extends infer T_1 ? { [K in keyof T_1]?: (T_1[K] extends infer T_2 ? { [K_2 in keyof T_2]?: (T_2[K_2] extends infer T_3 ? { [K_3 in keyof T_3]?: (T_3[K_3] extends infer T_4 ? { [K_4 in keyof T_4]?: (T_4[K_4] extends infer T_5 ? { [K_5 in keyof T_5]?: (T_5[K_5] extends infer T_6 ? { [K_6 in keyof T_6]?: (T_6[K_6] extends infer T_7 ? { [K_7 in keyof T_7]?: (T_7[K_7] extends infer T_8 ? { [K_8 in keyof T_8]?: (T_8[K_8] extends infer T_9 ? { [K_9 in keyof T_9]?: (T_9[K_9] extends infer T_10 ? { [K_10 in keyof T_10]?: (T_10[K_10] extends infer T_11 ? { [K_11 in keyof T_11]?: /*elided*/any | undefined } : never) | undefined } : never) | undefined } : never) | undefined } : never) | undefined } : never) | undefined } : never) | undefined } : never) | undefined } : never) | undefined } : never) | undefined } : never) | undefined } : never) & Record<string, any>>) & ((this: UnresolvedContext<TContext["config"]>) => _$_stryke_types_base0.MaybePromise<(TContext["config"] extends infer T_1 ? { [K in keyof T_1]?: (T_1[K] extends infer T_2 ? { [K_2 in keyof T_2]?: (T_2[K_2] extends infer T_3 ? { [K_3 in keyof T_3]?: (T_3[K_3] extends infer T_4 ? { [K_4 in keyof T_4]?: (T_4[K_4] extends infer T_5 ? { [K_5 in keyof T_5]?: (T_5[K_5] extends infer T_6 ? { [K_6 in keyof T_6]?: (T_6[K_6] extends infer T_7 ? { [K_7 in keyof T_7]?: (T_7[K_7] extends infer T_8 ? { [K_8 in keyof T_8]?: (T_8[K_8] extends infer T_9 ? { [K_9 in keyof T_9]?: (T_9[K_9] extends infer T_10 ? { [K_10 in keyof T_10]?: (T_10[K_10] extends infer T_11 ? { [K_11 in keyof T_11]?: /*elided*/any | undefined } : never) | undefined } : never) | undefined } : never) | undefined } : never) | undefined } : never) | undefined } : never) | undefined } : never) | undefined } : never) | undefined } : never) | undefined } : never) | undefined } : never) & Record<string, any>>)) | ((this: TContext, code: string) => _$_stryke_types_base0.MaybePromise<TypesResult | string | undefined | null>) | ((this: TContext) => _$_stryke_types_base0.MaybePromise<void>) | ((this: TContext, name: string, environment: EnvironmentConfig) => _$_stryke_types_base0.MaybePromise<Partial<EnvironmentResolvedConfig> | undefined | null>) | ((this: TContext) => _$_stryke_types_base0.MaybePromise<void>) | ((this: _$unplugin.UnpluginBuildContext & PluginContext<TContext["config"]> & TContext) => _$_stryke_types_base0.MaybePromise<void>) | ((this: _$unplugin.UnpluginBuildContext & PluginContext<TContext["config"]> & TContext) => _$_stryke_types_base0.MaybePromise<void>) | ((this: TContext) => _$_stryke_types_base0.MaybePromise<void>)>;
92
+ }) => _$_stryke_types_base0.MaybePromise<string | ResolveResult | null | undefined>) | ((this: UnresolvedContext<TContext["config"]>) => _$_stryke_types_base0.MaybePromise<(TContext["config"] extends infer T_1 ? { [K in keyof T_1]?: (T_1[K] extends infer T_2 ? { [K_2 in keyof T_2]?: (T_2[K_2] extends infer T_3 ? { [K_3 in keyof T_3]?: (T_3[K_3] extends infer T_4 ? { [K_4 in keyof T_4]?: (T_4[K_4] extends infer T_5 ? { [K_5 in keyof T_5]?: (T_5[K_5] extends infer T_6 ? { [K_6 in keyof T_6]?: (T_6[K_6] extends infer T_7 ? { [K_7 in keyof T_7]?: (T_7[K_7] extends infer T_8 ? { [K_8 in keyof T_8]?: (T_8[K_8] extends infer T_9 ? { [K_9 in keyof T_9]?: (T_9[K_9] extends infer T_10 ? { [K_10 in keyof T_10]?: (T_10[K_10] extends infer T_11 ? { [K_11 in keyof T_11]?: /*elided*/any | undefined } : never) | undefined } : never) | undefined } : never) | undefined } : never) | undefined } : never) | undefined } : never) | undefined } : never) | undefined } : never) | undefined } : never) | undefined } : never) | undefined } : never) & Record<string, any>>) | (((this: UnresolvedContext<TContext["config"]>) => _$_stryke_types_base0.MaybePromise<(TContext["config"] extends infer T_1 ? { [K in keyof T_1]?: (T_1[K] extends infer T_2 ? { [K_2 in keyof T_2]?: (T_2[K_2] extends infer T_3 ? { [K_3 in keyof T_3]?: (T_3[K_3] extends infer T_4 ? { [K_4 in keyof T_4]?: (T_4[K_4] extends infer T_5 ? { [K_5 in keyof T_5]?: (T_5[K_5] extends infer T_6 ? { [K_6 in keyof T_6]?: (T_6[K_6] extends infer T_7 ? { [K_7 in keyof T_7]?: (T_7[K_7] extends infer T_8 ? { [K_8 in keyof T_8]?: (T_8[K_8] extends infer T_9 ? { [K_9 in keyof T_9]?: (T_9[K_9] extends infer T_10 ? { [K_10 in keyof T_10]?: (T_10[K_10] extends infer T_11 ? { [K_11 in keyof T_11]?: /*elided*/any | undefined } : never) | undefined } : never) | undefined } : never) | undefined } : never) | undefined } : never) | undefined } : never) | undefined } : never) | undefined } : never) | undefined } : never) | undefined } : never) | undefined } : never) & Record<string, any>>) & ((this: UnresolvedContext<TContext["config"]>) => _$_stryke_types_base0.MaybePromise<(TContext["config"] extends infer T_1 ? { [K in keyof T_1]?: (T_1[K] extends infer T_2 ? { [K_2 in keyof T_2]?: (T_2[K_2] extends infer T_3 ? { [K_3 in keyof T_3]?: (T_3[K_3] extends infer T_4 ? { [K_4 in keyof T_4]?: (T_4[K_4] extends infer T_5 ? { [K_5 in keyof T_5]?: (T_5[K_5] extends infer T_6 ? { [K_6 in keyof T_6]?: (T_6[K_6] extends infer T_7 ? { [K_7 in keyof T_7]?: (T_7[K_7] extends infer T_8 ? { [K_8 in keyof T_8]?: (T_8[K_8] extends infer T_9 ? { [K_9 in keyof T_9]?: (T_9[K_9] extends infer T_10 ? { [K_10 in keyof T_10]?: (T_10[K_10] extends infer T_11 ? { [K_11 in keyof T_11]?: /*elided*/any | undefined } : never) | undefined } : never) | undefined } : never) | undefined } : never) | undefined } : never) | undefined } : never) | undefined } : never) | undefined } : never) | undefined } : never) | undefined } : never) | undefined } : never) & Record<string, any>>)) | ((this: TContext) => _$_stryke_types_base0.MaybePromise<void>) | ((this: TContext, name: string, environment: EnvironmentConfig) => _$_stryke_types_base0.MaybePromise<Partial<EnvironmentResolvedConfig> | undefined | null>) | ((this: TContext) => _$_stryke_types_base0.MaybePromise<void>) | ((this: TContext, code: string) => _$_stryke_types_base0.MaybePromise<TypesResult | string | undefined | null>) | ((this: _$unplugin.UnpluginBuildContext & PluginContext<TContext["config"]> & TContext) => _$_stryke_types_base0.MaybePromise<void>) | ((this: _$unplugin.UnpluginBuildContext & PluginContext<TContext["config"]> & TContext) => _$_stryke_types_base0.MaybePromise<void>) | ((this: TContext) => _$_stryke_types_base0.MaybePromise<void>)>;
93
93
  normal?: undefined;
94
94
  } | undefined;
95
95
  /**
@@ -120,7 +120,14 @@ declare function isUnpluginHookField<TUnpluginBuilderVariant extends UnpluginBui
120
120
  * @param plugins - The list of plugins to check against
121
121
  * @returns True if the plugin should be deduplicated, false otherwise
122
122
  */
123
- declare function checkDedupe<TResolvedConfig extends ResolvedConfig = ResolvedConfig, TContext extends PluginContext<TResolvedConfig> = PluginContext<TResolvedConfig>>(plugin: Plugin<TContext>, plugins: Plugin<TContext>[]): boolean;
123
+ declare function isDuplicate<TResolvedConfig extends ResolvedConfig = ResolvedConfig, TContext extends PluginContext<TResolvedConfig> = PluginContext<TResolvedConfig>>(plugin: Plugin<TContext>, plugins: Plugin<TContext>[]): boolean;
124
+ /**
125
+ * Remove duplicate hooks from a list of hooks, keeping the first occurrence of each plugin.
126
+ *
127
+ * @param hooksList - The list of hooks to deduplicate.
128
+ * @returns A new list of hooks with duplicates removed.
129
+ */
130
+ declare function dedupeHooklist<TContext extends PluginContext = PluginContext, TField extends PluginHookFields<TContext> = PluginHookFields<TContext>, TList extends HooksListItem<TContext, TField> = HooksListItem<TContext, TField>>(hooksList: TList[]): TList[];
124
131
  /**
125
132
  * Add a plugin hook to the hooks list.
126
133
  *
@@ -129,7 +136,7 @@ declare function checkDedupe<TResolvedConfig extends ResolvedConfig = ResolvedCo
129
136
  * @param pluginHook - The plugin hook to add
130
137
  * @param hooksList - The list of hooks to add to
131
138
  */
132
- declare function addPluginHook<TContext extends PluginContext = PluginContext, TField extends PluginHookFields<TContext> = PluginHookFields<TContext>, TList extends HooksListItem<TContext, TField> = HooksListItem<TContext, TField>>(context: TContext, plugin: Plugin<TContext>, pluginHook: PluginHook<AnyFunction>, hooksList: TList[]): void;
139
+ declare function addPluginHook<TContext extends PluginContext = PluginContext, TField extends PluginHookFields<TContext> = PluginHookFields<TContext>, TList extends HooksListItem<TContext, TField> = HooksListItem<TContext, TField>>(context: TContext, plugin: Plugin<TContext>, pluginHook: PluginHook<AnyFunction>, hooksList: TList[]): TList[];
133
140
  /**
134
141
  * Check the provided {@link PluginConfig}, and return a stringified version of the invalid configuration. If an array is provided, check each item in the array.
135
142
  *
@@ -139,5 +146,5 @@ declare function addPluginHook<TContext extends PluginContext = PluginContext, T
139
146
  declare function findInvalidPluginConfig<TContext extends PluginContext = PluginContext<ResolvedConfig>>(config: PluginConfig<TContext>): string[] | null;
140
147
  declare type __ΩGetHookHandlerReturnType = any[];
141
148
  //#endregion
142
- export { GetHookHandlerReturnType, __ΩGetHookHandlerReturnType, addPluginHook, checkDedupe, extractPluginHook, findInvalidPluginConfig, getHookHandler, isPlugin, isPluginConfig, isPluginConfigObject, isPluginConfigTuple, isPluginHook, isPluginHookField, isPluginHookFunction, isPluginHookObject, isUnpluginHookField, isUnpluginHookKey };
149
+ export { GetHookHandlerReturnType, __ΩGetHookHandlerReturnType, addPluginHook, dedupeHooklist, extractPluginHook, findInvalidPluginConfig, getHookHandler, isDuplicate, isPlugin, isPluginConfig, isPluginConfigObject, isPluginConfigTuple, isPluginHook, isPluginHookField, isPluginHookFunction, isPluginHookObject, isUnpluginHookField, isUnpluginHookKey };
143
150
  //# sourceMappingURL=helpers.d.cts.map
@@ -1 +1 @@
1
- {"version":3,"file":"helpers.d.cts","names":[],"sources":["../../src/plugin-utils/helpers.ts"],"mappings":";;;;;;;;;;;;;;;;;iBAsDgB,QAAA,kBACG,aAAA,GAAgB,aAAA,CAAc,cAAA,EAAA,CAC/C,KAAA,YAAiB,KAAA,IAAS,MAAA,CAAO,QAAA;;;;;;;iBA6BnB,oBAAA,kBACG,aAAA,GAAgB,aAAA,CAAc,cAAA,EAAA,CAC/C,KAAA,YAAiB,KAAA,IAAS,kBAAA,CAAmB,QAAA;;;;;;;iBAiB/B,mBAAA,kBACG,aAAA,GAAgB,aAAA,CAAc,cAAA,EAAA,CAC/C,KAAA,YAAiB,KAAA,IAAS,iBAAA,CAAkB,QAAA;;;;;;AArB9C;iBAsCgB,cAAA,kBACG,aAAA,GAAgB,aAAA,CAAc,cAAA,EAAA,CAC/C,KAAA,YAAiB,KAAA,IAAS,YAAA,CAAa,QAAA;;;;;;;iBAiBzB,kBAAA,CACd,KAAA,YACC,KAAA,IAAS,gBAAA,CAAiB,WAAA;;;;;;;iBAUb,oBAAA,CAAqB,KAAA,YAA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,QAAA,EACA,MAAA,EAAA,CAGF,OAAA,EAAS,QAAA,EACT,MAAA,EAAQ,MAAA,CAAO,QAAA,GACf,UAAA,EAAY,UAAA,CAAW,WAAA,GACvB,SAAA,EAAW,KAAA,KACV,KAAA;;;;;;;iBA6Ba,uBAAA,kBACG,aAAA,GAAgB,aAAA,CAAc,cAAA,EAAA,CAC/C,MAAA,EAAQ,YAAA,CAAa,QAAA;AAAA"}
@@ -85,11 +85,11 @@ declare function extractPluginHook<TContext extends PluginContext = PluginContex
85
85
  isEntry: boolean;
86
86
  }) => _$_stryke_types_base0.MaybePromise<string | ResolveResult | null | undefined>, never> & ((this: _$unplugin.UnpluginBuildContext & PluginContext<TContext["config"]> & TContext, id: string, importer: string | undefined, options: {
87
87
  isEntry: boolean;
88
- }) => _$_stryke_types_base0.MaybePromise<string | ResolveResult | null | undefined>)) | (((this: UnresolvedContext<TContext["config"]>) => _$_stryke_types_base0.MaybePromise<(TContext["config"] extends infer T ? { [K in keyof T]?: (T[K] extends infer T_1 ? { [K_2 in keyof T_1]?: (T_1[K_2] extends infer T_2 ? { [K_3 in keyof T_2]?: (T_2[K_3] extends infer T_3 ? { [K_4 in keyof T_3]?: (T_3[K_4] extends infer T_4 ? { [K_5 in keyof T_4]?: (T_4[K_5] extends infer T_5 ? { [K_6 in keyof T_5]?: (T_5[K_6] extends infer T_6 ? { [K_7 in keyof T_6]?: (T_6[K_7] extends infer T_7 ? { [K_8 in keyof T_7]?: (T_7[K_8] extends infer T_8 ? { [K_9 in keyof T_8]?: (T_8[K_9] extends infer T_9 ? { [K_10 in keyof T_9]?: (T_9[K_10] extends infer T_10 ? { [K_11 in keyof T_10]?: /*elided*/any | undefined } : never) | undefined } : never) | undefined } : never) | undefined } : never) | undefined } : never) | undefined } : never) | undefined } : never) | undefined } : never) | undefined } : never) | undefined } : never) | undefined } : never) & Record<string, any>>) & ((this: UnresolvedContext<TContext["config"]>) => _$_stryke_types_base0.MaybePromise<(TContext["config"] extends infer T ? { [K in keyof T]?: (T[K] extends infer T_1 ? { [K_2 in keyof T_1]?: (T_1[K_2] extends infer T_2 ? { [K_3 in keyof T_2]?: (T_2[K_3] extends infer T_3 ? { [K_4 in keyof T_3]?: (T_3[K_4] extends infer T_4 ? { [K_5 in keyof T_4]?: (T_4[K_5] extends infer T_5 ? { [K_6 in keyof T_5]?: (T_5[K_6] extends infer T_6 ? { [K_7 in keyof T_6]?: (T_6[K_7] extends infer T_7 ? { [K_8 in keyof T_7]?: (T_7[K_8] extends infer T_8 ? { [K_9 in keyof T_8]?: (T_8[K_9] extends infer T_9 ? { [K_10 in keyof T_9]?: (T_9[K_10] extends infer T_10 ? { [K_11 in keyof T_10]?: /*elided*/any | undefined } : never) | undefined } : never) | undefined } : never) | undefined } : never) | undefined } : never) | undefined } : never) | undefined } : never) | undefined } : never) | undefined } : never) | undefined } : never) | undefined } : never) & Record<string, any>>)) | (((this: UnresolvedContext<TContext["config"]>) => _$_stryke_types_base0.MaybePromise<(TContext["config"] extends infer T ? { [K in keyof T]?: (T[K] extends infer T_1 ? { [K_2 in keyof T_1]?: (T_1[K_2] extends infer T_2 ? { [K_3 in keyof T_2]?: (T_2[K_3] extends infer T_3 ? { [K_4 in keyof T_3]?: (T_3[K_4] extends infer T_4 ? { [K_5 in keyof T_4]?: (T_4[K_5] extends infer T_5 ? { [K_6 in keyof T_5]?: (T_5[K_6] extends infer T_6 ? { [K_7 in keyof T_6]?: (T_6[K_7] extends infer T_7 ? { [K_8 in keyof T_7]?: (T_7[K_8] extends infer T_8 ? { [K_9 in keyof T_8]?: (T_8[K_9] extends infer T_9 ? { [K_10 in keyof T_9]?: (T_9[K_10] extends infer T_10 ? { [K_11 in keyof T_10]?: /*elided*/any | undefined } : never) | undefined } : never) | undefined } : never) | undefined } : never) | undefined } : never) | undefined } : never) | undefined } : never) | undefined } : never) | undefined } : never) | undefined } : never) | undefined } : never) & Record<string, any>>) & PluginHookObject<(this: UnresolvedContext<TContext["config"]>) => _$_stryke_types_base0.MaybePromise<(TContext["config"] extends infer T ? { [K in keyof T]?: (T[K] extends infer T_1 ? { [K_2 in keyof T_1]?: (T_1[K_2] extends infer T_2 ? { [K_3 in keyof T_2]?: (T_2[K_3] extends infer T_3 ? { [K_4 in keyof T_3]?: (T_3[K_4] extends infer T_4 ? { [K_5 in keyof T_4]?: (T_4[K_5] extends infer T_5 ? { [K_6 in keyof T_5]?: (T_5[K_6] extends infer T_6 ? { [K_7 in keyof T_6]?: (T_6[K_7] extends infer T_7 ? { [K_8 in keyof T_7]?: (T_7[K_8] extends infer T_8 ? { [K_9 in keyof T_8]?: (T_8[K_9] extends infer T_9 ? { [K_10 in keyof T_9]?: (T_9[K_10] extends infer T_10 ? { [K_11 in keyof T_10]?: /*elided*/any | undefined } : never) | undefined } : never) | undefined } : never) | undefined } : never) | undefined } : never) | undefined } : never) | undefined } : never) | undefined } : never) | undefined } : never) | undefined } : never) | undefined } : never) & Record<string, any>>, never>) | (((this: UnresolvedContext<TContext["config"]>) => _$_stryke_types_base0.MaybePromise<(TContext["config"] extends infer T ? { [K in keyof T]?: (T[K] extends infer T_1 ? { [K_2 in keyof T_1]?: (T_1[K_2] extends infer T_2 ? { [K_3 in keyof T_2]?: (T_2[K_3] extends infer T_3 ? { [K_4 in keyof T_3]?: (T_3[K_4] extends infer T_4 ? { [K_5 in keyof T_4]?: (T_4[K_5] extends infer T_5 ? { [K_6 in keyof T_5]?: (T_5[K_6] extends infer T_6 ? { [K_7 in keyof T_6]?: (T_6[K_7] extends infer T_7 ? { [K_8 in keyof T_7]?: (T_7[K_8] extends infer T_8 ? { [K_9 in keyof T_8]?: (T_8[K_9] extends infer T_9 ? { [K_10 in keyof T_9]?: (T_9[K_10] extends infer T_10 ? { [K_11 in keyof T_10]?: /*elided*/any | undefined } : never) | undefined } : never) | undefined } : never) | undefined } : never) | undefined } : never) | undefined } : never) | undefined } : never) | undefined } : never) | undefined } : never) | undefined } : never) | undefined } : never) & Record<string, any>>) & (TContext["config"] extends infer T ? { [K in keyof T]?: (T[K] extends infer T_1 ? { [K_2 in keyof T_1]?: (T_1[K_2] extends infer T_2 ? { [K_3 in keyof T_2]?: (T_2[K_3] extends infer T_3 ? { [K_4 in keyof T_3]?: (T_3[K_4] extends infer T_4 ? { [K_5 in keyof T_4]?: (T_4[K_5] extends infer T_5 ? { [K_6 in keyof T_5]?: (T_5[K_6] extends infer T_6 ? { [K_7 in keyof T_6]?: (T_6[K_7] extends infer T_7 ? { [K_8 in keyof T_7]?: (T_7[K_8] extends infer T_8 ? { [K_9 in keyof T_8]?: (T_8[K_9] extends infer T_9 ? { [K_10 in keyof T_9]?: (T_9[K_10] extends infer T_10 ? { [K_11 in keyof T_10]?: /*elided*/any | undefined } : never) | undefined } : never) | undefined } : never) | undefined } : never) | undefined } : never) | undefined } : never) | undefined } : never) | undefined } : never) | undefined } : never) | undefined } : never) | undefined } : never) & Record<string, any>) | (PluginHookObject<(this: UnresolvedContext<TContext["config"]>) => _$_stryke_types_base0.MaybePromise<(TContext["config"] extends infer T_1 ? { [K in keyof T_1]?: (T_1[K] extends infer T_2 ? { [K_2 in keyof T_2]?: (T_2[K_2] extends infer T_3 ? { [K_3 in keyof T_3]?: (T_3[K_3] extends infer T_4 ? { [K_4 in keyof T_4]?: (T_4[K_4] extends infer T_5 ? { [K_5 in keyof T_5]?: (T_5[K_5] extends infer T_6 ? { [K_6 in keyof T_6]?: (T_6[K_6] extends infer T_7 ? { [K_7 in keyof T_7]?: (T_7[K_7] extends infer T_8 ? { [K_8 in keyof T_8]?: (T_8[K_8] extends infer T_9 ? { [K_9 in keyof T_9]?: (T_9[K_9] extends infer T_10 ? { [K_10 in keyof T_10]?: (T_10[K_10] extends infer T_11 ? { [K_11 in keyof T_11]?: /*elided*/any | undefined } : never) | undefined } : never) | undefined } : never) | undefined } : never) | undefined } : never) | undefined } : never) | undefined } : never) | undefined } : never) | undefined } : never) | undefined } : never) | undefined } : never) & Record<string, any>>, never> & ((this: UnresolvedContext<TContext["config"]>) => _$_stryke_types_base0.MaybePromise<(TContext["config"] extends infer T_1 ? { [K in keyof T_1]?: (T_1[K] extends infer T_2 ? { [K_2 in keyof T_2]?: (T_2[K_2] extends infer T_3 ? { [K_3 in keyof T_3]?: (T_3[K_3] extends infer T_4 ? { [K_4 in keyof T_4]?: (T_4[K_4] extends infer T_5 ? { [K_5 in keyof T_5]?: (T_5[K_5] extends infer T_6 ? { [K_6 in keyof T_6]?: (T_6[K_6] extends infer T_7 ? { [K_7 in keyof T_7]?: (T_7[K_7] extends infer T_8 ? { [K_8 in keyof T_8]?: (T_8[K_8] extends infer T_9 ? { [K_9 in keyof T_9]?: (T_9[K_9] extends infer T_10 ? { [K_10 in keyof T_10]?: (T_10[K_10] extends infer T_11 ? { [K_11 in keyof T_11]?: /*elided*/any | undefined } : never) | undefined } : never) | undefined } : never) | undefined } : never) | undefined } : never) | undefined } : never) | undefined } : never) | undefined } : never) | undefined } : never) | undefined } : never) | undefined } : never) & Record<string, any>>)) | ((this: TContext, code: string) => _$_stryke_types_base0.MaybePromise<TypesResult | string | undefined | null>) | ((this: TContext) => _$_stryke_types_base0.MaybePromise<void>) | ((this: TContext, name: string, environment: EnvironmentConfig) => _$_stryke_types_base0.MaybePromise<Partial<EnvironmentResolvedConfig> | undefined | null>) | ((this: TContext) => _$_stryke_types_base0.MaybePromise<void>) | ((this: _$unplugin.UnpluginBuildContext & PluginContext<TContext["config"]> & TContext) => _$_stryke_types_base0.MaybePromise<void>) | ((this: _$unplugin.UnpluginBuildContext & PluginContext<TContext["config"]> & TContext) => _$_stryke_types_base0.MaybePromise<void>) | ((this: TContext) => _$_stryke_types_base0.MaybePromise<void>)>;
88
+ }) => _$_stryke_types_base0.MaybePromise<string | ResolveResult | null | undefined>)) | (((this: UnresolvedContext<TContext["config"]>) => _$_stryke_types_base0.MaybePromise<(TContext["config"] extends infer T ? { [K in keyof T]?: (T[K] extends infer T_1 ? { [K_2 in keyof T_1]?: (T_1[K_2] extends infer T_2 ? { [K_3 in keyof T_2]?: (T_2[K_3] extends infer T_3 ? { [K_4 in keyof T_3]?: (T_3[K_4] extends infer T_4 ? { [K_5 in keyof T_4]?: (T_4[K_5] extends infer T_5 ? { [K_6 in keyof T_5]?: (T_5[K_6] extends infer T_6 ? { [K_7 in keyof T_6]?: (T_6[K_7] extends infer T_7 ? { [K_8 in keyof T_7]?: (T_7[K_8] extends infer T_8 ? { [K_9 in keyof T_8]?: (T_8[K_9] extends infer T_9 ? { [K_10 in keyof T_9]?: (T_9[K_10] extends infer T_10 ? { [K_11 in keyof T_10]?: /*elided*/any | undefined } : never) | undefined } : never) | undefined } : never) | undefined } : never) | undefined } : never) | undefined } : never) | undefined } : never) | undefined } : never) | undefined } : never) | undefined } : never) | undefined } : never) & Record<string, any>>) & ((this: UnresolvedContext<TContext["config"]>) => _$_stryke_types_base0.MaybePromise<(TContext["config"] extends infer T ? { [K in keyof T]?: (T[K] extends infer T_1 ? { [K_2 in keyof T_1]?: (T_1[K_2] extends infer T_2 ? { [K_3 in keyof T_2]?: (T_2[K_3] extends infer T_3 ? { [K_4 in keyof T_3]?: (T_3[K_4] extends infer T_4 ? { [K_5 in keyof T_4]?: (T_4[K_5] extends infer T_5 ? { [K_6 in keyof T_5]?: (T_5[K_6] extends infer T_6 ? { [K_7 in keyof T_6]?: (T_6[K_7] extends infer T_7 ? { [K_8 in keyof T_7]?: (T_7[K_8] extends infer T_8 ? { [K_9 in keyof T_8]?: (T_8[K_9] extends infer T_9 ? { [K_10 in keyof T_9]?: (T_9[K_10] extends infer T_10 ? { [K_11 in keyof T_10]?: /*elided*/any | undefined } : never) | undefined } : never) | undefined } : never) | undefined } : never) | undefined } : never) | undefined } : never) | undefined } : never) | undefined } : never) | undefined } : never) | undefined } : never) | undefined } : never) & Record<string, any>>)) | (((this: UnresolvedContext<TContext["config"]>) => _$_stryke_types_base0.MaybePromise<(TContext["config"] extends infer T ? { [K in keyof T]?: (T[K] extends infer T_1 ? { [K_2 in keyof T_1]?: (T_1[K_2] extends infer T_2 ? { [K_3 in keyof T_2]?: (T_2[K_3] extends infer T_3 ? { [K_4 in keyof T_3]?: (T_3[K_4] extends infer T_4 ? { [K_5 in keyof T_4]?: (T_4[K_5] extends infer T_5 ? { [K_6 in keyof T_5]?: (T_5[K_6] extends infer T_6 ? { [K_7 in keyof T_6]?: (T_6[K_7] extends infer T_7 ? { [K_8 in keyof T_7]?: (T_7[K_8] extends infer T_8 ? { [K_9 in keyof T_8]?: (T_8[K_9] extends infer T_9 ? { [K_10 in keyof T_9]?: (T_9[K_10] extends infer T_10 ? { [K_11 in keyof T_10]?: /*elided*/any | undefined } : never) | undefined } : never) | undefined } : never) | undefined } : never) | undefined } : never) | undefined } : never) | undefined } : never) | undefined } : never) | undefined } : never) | undefined } : never) | undefined } : never) & Record<string, any>>) & PluginHookObject<(this: UnresolvedContext<TContext["config"]>) => _$_stryke_types_base0.MaybePromise<(TContext["config"] extends infer T ? { [K in keyof T]?: (T[K] extends infer T_1 ? { [K_2 in keyof T_1]?: (T_1[K_2] extends infer T_2 ? { [K_3 in keyof T_2]?: (T_2[K_3] extends infer T_3 ? { [K_4 in keyof T_3]?: (T_3[K_4] extends infer T_4 ? { [K_5 in keyof T_4]?: (T_4[K_5] extends infer T_5 ? { [K_6 in keyof T_5]?: (T_5[K_6] extends infer T_6 ? { [K_7 in keyof T_6]?: (T_6[K_7] extends infer T_7 ? { [K_8 in keyof T_7]?: (T_7[K_8] extends infer T_8 ? { [K_9 in keyof T_8]?: (T_8[K_9] extends infer T_9 ? { [K_10 in keyof T_9]?: (T_9[K_10] extends infer T_10 ? { [K_11 in keyof T_10]?: /*elided*/any | undefined } : never) | undefined } : never) | undefined } : never) | undefined } : never) | undefined } : never) | undefined } : never) | undefined } : never) | undefined } : never) | undefined } : never) | undefined } : never) | undefined } : never) & Record<string, any>>, never>) | (((this: UnresolvedContext<TContext["config"]>) => _$_stryke_types_base0.MaybePromise<(TContext["config"] extends infer T ? { [K in keyof T]?: (T[K] extends infer T_1 ? { [K_2 in keyof T_1]?: (T_1[K_2] extends infer T_2 ? { [K_3 in keyof T_2]?: (T_2[K_3] extends infer T_3 ? { [K_4 in keyof T_3]?: (T_3[K_4] extends infer T_4 ? { [K_5 in keyof T_4]?: (T_4[K_5] extends infer T_5 ? { [K_6 in keyof T_5]?: (T_5[K_6] extends infer T_6 ? { [K_7 in keyof T_6]?: (T_6[K_7] extends infer T_7 ? { [K_8 in keyof T_7]?: (T_7[K_8] extends infer T_8 ? { [K_9 in keyof T_8]?: (T_8[K_9] extends infer T_9 ? { [K_10 in keyof T_9]?: (T_9[K_10] extends infer T_10 ? { [K_11 in keyof T_10]?: /*elided*/any | undefined } : never) | undefined } : never) | undefined } : never) | undefined } : never) | undefined } : never) | undefined } : never) | undefined } : never) | undefined } : never) | undefined } : never) | undefined } : never) | undefined } : never) & Record<string, any>>) & (TContext["config"] extends infer T ? { [K in keyof T]?: (T[K] extends infer T_1 ? { [K_2 in keyof T_1]?: (T_1[K_2] extends infer T_2 ? { [K_3 in keyof T_2]?: (T_2[K_3] extends infer T_3 ? { [K_4 in keyof T_3]?: (T_3[K_4] extends infer T_4 ? { [K_5 in keyof T_4]?: (T_4[K_5] extends infer T_5 ? { [K_6 in keyof T_5]?: (T_5[K_6] extends infer T_6 ? { [K_7 in keyof T_6]?: (T_6[K_7] extends infer T_7 ? { [K_8 in keyof T_7]?: (T_7[K_8] extends infer T_8 ? { [K_9 in keyof T_8]?: (T_8[K_9] extends infer T_9 ? { [K_10 in keyof T_9]?: (T_9[K_10] extends infer T_10 ? { [K_11 in keyof T_10]?: /*elided*/any | undefined } : never) | undefined } : never) | undefined } : never) | undefined } : never) | undefined } : never) | undefined } : never) | undefined } : never) | undefined } : never) | undefined } : never) | undefined } : never) | undefined } : never) & Record<string, any>) | (PluginHookObject<(this: UnresolvedContext<TContext["config"]>) => _$_stryke_types_base0.MaybePromise<(TContext["config"] extends infer T_1 ? { [K in keyof T_1]?: (T_1[K] extends infer T_2 ? { [K_2 in keyof T_2]?: (T_2[K_2] extends infer T_3 ? { [K_3 in keyof T_3]?: (T_3[K_3] extends infer T_4 ? { [K_4 in keyof T_4]?: (T_4[K_4] extends infer T_5 ? { [K_5 in keyof T_5]?: (T_5[K_5] extends infer T_6 ? { [K_6 in keyof T_6]?: (T_6[K_6] extends infer T_7 ? { [K_7 in keyof T_7]?: (T_7[K_7] extends infer T_8 ? { [K_8 in keyof T_8]?: (T_8[K_8] extends infer T_9 ? { [K_9 in keyof T_9]?: (T_9[K_9] extends infer T_10 ? { [K_10 in keyof T_10]?: (T_10[K_10] extends infer T_11 ? { [K_11 in keyof T_11]?: /*elided*/any | undefined } : never) | undefined } : never) | undefined } : never) | undefined } : never) | undefined } : never) | undefined } : never) | undefined } : never) | undefined } : never) | undefined } : never) | undefined } : never) | undefined } : never) & Record<string, any>>, never> & ((this: UnresolvedContext<TContext["config"]>) => _$_stryke_types_base0.MaybePromise<(TContext["config"] extends infer T_1 ? { [K in keyof T_1]?: (T_1[K] extends infer T_2 ? { [K_2 in keyof T_2]?: (T_2[K_2] extends infer T_3 ? { [K_3 in keyof T_3]?: (T_3[K_3] extends infer T_4 ? { [K_4 in keyof T_4]?: (T_4[K_4] extends infer T_5 ? { [K_5 in keyof T_5]?: (T_5[K_5] extends infer T_6 ? { [K_6 in keyof T_6]?: (T_6[K_6] extends infer T_7 ? { [K_7 in keyof T_7]?: (T_7[K_7] extends infer T_8 ? { [K_8 in keyof T_8]?: (T_8[K_8] extends infer T_9 ? { [K_9 in keyof T_9]?: (T_9[K_9] extends infer T_10 ? { [K_10 in keyof T_10]?: (T_10[K_10] extends infer T_11 ? { [K_11 in keyof T_11]?: /*elided*/any | undefined } : never) | undefined } : never) | undefined } : never) | undefined } : never) | undefined } : never) | undefined } : never) | undefined } : never) | undefined } : never) | undefined } : never) | undefined } : never) | undefined } : never) & Record<string, any>>)) | ((this: TContext) => _$_stryke_types_base0.MaybePromise<void>) | ((this: TContext, name: string, environment: EnvironmentConfig) => _$_stryke_types_base0.MaybePromise<Partial<EnvironmentResolvedConfig> | undefined | null>) | ((this: TContext) => _$_stryke_types_base0.MaybePromise<void>) | ((this: TContext, code: string) => _$_stryke_types_base0.MaybePromise<TypesResult | string | undefined | null>) | ((this: _$unplugin.UnpluginBuildContext & PluginContext<TContext["config"]> & TContext) => _$_stryke_types_base0.MaybePromise<void>) | ((this: _$unplugin.UnpluginBuildContext & PluginContext<TContext["config"]> & TContext) => _$_stryke_types_base0.MaybePromise<void>) | ((this: TContext) => _$_stryke_types_base0.MaybePromise<void>)>;
89
89
  } | {
90
90
  [x: string]: OmitThisParameter<((this: _$unplugin.UnpluginBuildContext & PluginContext<TContext["config"]> & TContext, code: string, id: string) => _$_stryke_types_base0.MaybePromise<_$unplugin.TransformResult>) | ((this: _$unplugin.UnpluginBuildContext & PluginContext<TContext["config"]> & TContext, id: string) => _$_stryke_types_base0.MaybePromise<_$rollup.LoadResult>) | ((this: _$unplugin.UnpluginBuildContext & PluginContext<TContext["config"]> & TContext, id: string, importer: string | undefined, options: {
91
91
  isEntry: boolean;
92
- }) => _$_stryke_types_base0.MaybePromise<string | ResolveResult | null | undefined>) | ((this: UnresolvedContext<TContext["config"]>) => _$_stryke_types_base0.MaybePromise<(TContext["config"] extends infer T_1 ? { [K in keyof T_1]?: (T_1[K] extends infer T_2 ? { [K_2 in keyof T_2]?: (T_2[K_2] extends infer T_3 ? { [K_3 in keyof T_3]?: (T_3[K_3] extends infer T_4 ? { [K_4 in keyof T_4]?: (T_4[K_4] extends infer T_5 ? { [K_5 in keyof T_5]?: (T_5[K_5] extends infer T_6 ? { [K_6 in keyof T_6]?: (T_6[K_6] extends infer T_7 ? { [K_7 in keyof T_7]?: (T_7[K_7] extends infer T_8 ? { [K_8 in keyof T_8]?: (T_8[K_8] extends infer T_9 ? { [K_9 in keyof T_9]?: (T_9[K_9] extends infer T_10 ? { [K_10 in keyof T_10]?: (T_10[K_10] extends infer T_11 ? { [K_11 in keyof T_11]?: /*elided*/any | undefined } : never) | undefined } : never) | undefined } : never) | undefined } : never) | undefined } : never) | undefined } : never) | undefined } : never) | undefined } : never) | undefined } : never) | undefined } : never) | undefined } : never) & Record<string, any>>) | (((this: UnresolvedContext<TContext["config"]>) => _$_stryke_types_base0.MaybePromise<(TContext["config"] extends infer T_1 ? { [K in keyof T_1]?: (T_1[K] extends infer T_2 ? { [K_2 in keyof T_2]?: (T_2[K_2] extends infer T_3 ? { [K_3 in keyof T_3]?: (T_3[K_3] extends infer T_4 ? { [K_4 in keyof T_4]?: (T_4[K_4] extends infer T_5 ? { [K_5 in keyof T_5]?: (T_5[K_5] extends infer T_6 ? { [K_6 in keyof T_6]?: (T_6[K_6] extends infer T_7 ? { [K_7 in keyof T_7]?: (T_7[K_7] extends infer T_8 ? { [K_8 in keyof T_8]?: (T_8[K_8] extends infer T_9 ? { [K_9 in keyof T_9]?: (T_9[K_9] extends infer T_10 ? { [K_10 in keyof T_10]?: (T_10[K_10] extends infer T_11 ? { [K_11 in keyof T_11]?: /*elided*/any | undefined } : never) | undefined } : never) | undefined } : never) | undefined } : never) | undefined } : never) | undefined } : never) | undefined } : never) | undefined } : never) | undefined } : never) | undefined } : never) | undefined } : never) & Record<string, any>>) & ((this: UnresolvedContext<TContext["config"]>) => _$_stryke_types_base0.MaybePromise<(TContext["config"] extends infer T_1 ? { [K in keyof T_1]?: (T_1[K] extends infer T_2 ? { [K_2 in keyof T_2]?: (T_2[K_2] extends infer T_3 ? { [K_3 in keyof T_3]?: (T_3[K_3] extends infer T_4 ? { [K_4 in keyof T_4]?: (T_4[K_4] extends infer T_5 ? { [K_5 in keyof T_5]?: (T_5[K_5] extends infer T_6 ? { [K_6 in keyof T_6]?: (T_6[K_6] extends infer T_7 ? { [K_7 in keyof T_7]?: (T_7[K_7] extends infer T_8 ? { [K_8 in keyof T_8]?: (T_8[K_8] extends infer T_9 ? { [K_9 in keyof T_9]?: (T_9[K_9] extends infer T_10 ? { [K_10 in keyof T_10]?: (T_10[K_10] extends infer T_11 ? { [K_11 in keyof T_11]?: /*elided*/any | undefined } : never) | undefined } : never) | undefined } : never) | undefined } : never) | undefined } : never) | undefined } : never) | undefined } : never) | undefined } : never) | undefined } : never) | undefined } : never) | undefined } : never) & Record<string, any>>)) | ((this: TContext, code: string) => _$_stryke_types_base0.MaybePromise<TypesResult | string | undefined | null>) | ((this: TContext) => _$_stryke_types_base0.MaybePromise<void>) | ((this: TContext, name: string, environment: EnvironmentConfig) => _$_stryke_types_base0.MaybePromise<Partial<EnvironmentResolvedConfig> | undefined | null>) | ((this: TContext) => _$_stryke_types_base0.MaybePromise<void>) | ((this: _$unplugin.UnpluginBuildContext & PluginContext<TContext["config"]> & TContext) => _$_stryke_types_base0.MaybePromise<void>) | ((this: _$unplugin.UnpluginBuildContext & PluginContext<TContext["config"]> & TContext) => _$_stryke_types_base0.MaybePromise<void>) | ((this: TContext) => _$_stryke_types_base0.MaybePromise<void>)>;
92
+ }) => _$_stryke_types_base0.MaybePromise<string | ResolveResult | null | undefined>) | ((this: UnresolvedContext<TContext["config"]>) => _$_stryke_types_base0.MaybePromise<(TContext["config"] extends infer T_1 ? { [K in keyof T_1]?: (T_1[K] extends infer T_2 ? { [K_2 in keyof T_2]?: (T_2[K_2] extends infer T_3 ? { [K_3 in keyof T_3]?: (T_3[K_3] extends infer T_4 ? { [K_4 in keyof T_4]?: (T_4[K_4] extends infer T_5 ? { [K_5 in keyof T_5]?: (T_5[K_5] extends infer T_6 ? { [K_6 in keyof T_6]?: (T_6[K_6] extends infer T_7 ? { [K_7 in keyof T_7]?: (T_7[K_7] extends infer T_8 ? { [K_8 in keyof T_8]?: (T_8[K_8] extends infer T_9 ? { [K_9 in keyof T_9]?: (T_9[K_9] extends infer T_10 ? { [K_10 in keyof T_10]?: (T_10[K_10] extends infer T_11 ? { [K_11 in keyof T_11]?: /*elided*/any | undefined } : never) | undefined } : never) | undefined } : never) | undefined } : never) | undefined } : never) | undefined } : never) | undefined } : never) | undefined } : never) | undefined } : never) | undefined } : never) | undefined } : never) & Record<string, any>>) | (((this: UnresolvedContext<TContext["config"]>) => _$_stryke_types_base0.MaybePromise<(TContext["config"] extends infer T_1 ? { [K in keyof T_1]?: (T_1[K] extends infer T_2 ? { [K_2 in keyof T_2]?: (T_2[K_2] extends infer T_3 ? { [K_3 in keyof T_3]?: (T_3[K_3] extends infer T_4 ? { [K_4 in keyof T_4]?: (T_4[K_4] extends infer T_5 ? { [K_5 in keyof T_5]?: (T_5[K_5] extends infer T_6 ? { [K_6 in keyof T_6]?: (T_6[K_6] extends infer T_7 ? { [K_7 in keyof T_7]?: (T_7[K_7] extends infer T_8 ? { [K_8 in keyof T_8]?: (T_8[K_8] extends infer T_9 ? { [K_9 in keyof T_9]?: (T_9[K_9] extends infer T_10 ? { [K_10 in keyof T_10]?: (T_10[K_10] extends infer T_11 ? { [K_11 in keyof T_11]?: /*elided*/any | undefined } : never) | undefined } : never) | undefined } : never) | undefined } : never) | undefined } : never) | undefined } : never) | undefined } : never) | undefined } : never) | undefined } : never) | undefined } : never) | undefined } : never) & Record<string, any>>) & ((this: UnresolvedContext<TContext["config"]>) => _$_stryke_types_base0.MaybePromise<(TContext["config"] extends infer T_1 ? { [K in keyof T_1]?: (T_1[K] extends infer T_2 ? { [K_2 in keyof T_2]?: (T_2[K_2] extends infer T_3 ? { [K_3 in keyof T_3]?: (T_3[K_3] extends infer T_4 ? { [K_4 in keyof T_4]?: (T_4[K_4] extends infer T_5 ? { [K_5 in keyof T_5]?: (T_5[K_5] extends infer T_6 ? { [K_6 in keyof T_6]?: (T_6[K_6] extends infer T_7 ? { [K_7 in keyof T_7]?: (T_7[K_7] extends infer T_8 ? { [K_8 in keyof T_8]?: (T_8[K_8] extends infer T_9 ? { [K_9 in keyof T_9]?: (T_9[K_9] extends infer T_10 ? { [K_10 in keyof T_10]?: (T_10[K_10] extends infer T_11 ? { [K_11 in keyof T_11]?: /*elided*/any | undefined } : never) | undefined } : never) | undefined } : never) | undefined } : never) | undefined } : never) | undefined } : never) | undefined } : never) | undefined } : never) | undefined } : never) | undefined } : never) | undefined } : never) & Record<string, any>>)) | ((this: TContext) => _$_stryke_types_base0.MaybePromise<void>) | ((this: TContext, name: string, environment: EnvironmentConfig) => _$_stryke_types_base0.MaybePromise<Partial<EnvironmentResolvedConfig> | undefined | null>) | ((this: TContext) => _$_stryke_types_base0.MaybePromise<void>) | ((this: TContext, code: string) => _$_stryke_types_base0.MaybePromise<TypesResult | string | undefined | null>) | ((this: _$unplugin.UnpluginBuildContext & PluginContext<TContext["config"]> & TContext) => _$_stryke_types_base0.MaybePromise<void>) | ((this: _$unplugin.UnpluginBuildContext & PluginContext<TContext["config"]> & TContext) => _$_stryke_types_base0.MaybePromise<void>) | ((this: TContext) => _$_stryke_types_base0.MaybePromise<void>)>;
93
93
  normal?: undefined;
94
94
  } | undefined;
95
95
  /**
@@ -120,7 +120,14 @@ declare function isUnpluginHookField<TUnpluginBuilderVariant extends UnpluginBui
120
120
  * @param plugins - The list of plugins to check against
121
121
  * @returns True if the plugin should be deduplicated, false otherwise
122
122
  */
123
- declare function checkDedupe<TResolvedConfig extends ResolvedConfig = ResolvedConfig, TContext extends PluginContext<TResolvedConfig> = PluginContext<TResolvedConfig>>(plugin: Plugin<TContext>, plugins: Plugin<TContext>[]): boolean;
123
+ declare function isDuplicate<TResolvedConfig extends ResolvedConfig = ResolvedConfig, TContext extends PluginContext<TResolvedConfig> = PluginContext<TResolvedConfig>>(plugin: Plugin<TContext>, plugins: Plugin<TContext>[]): boolean;
124
+ /**
125
+ * Remove duplicate hooks from a list of hooks, keeping the first occurrence of each plugin.
126
+ *
127
+ * @param hooksList - The list of hooks to deduplicate.
128
+ * @returns A new list of hooks with duplicates removed.
129
+ */
130
+ declare function dedupeHooklist<TContext extends PluginContext = PluginContext, TField extends PluginHookFields<TContext> = PluginHookFields<TContext>, TList extends HooksListItem<TContext, TField> = HooksListItem<TContext, TField>>(hooksList: TList[]): TList[];
124
131
  /**
125
132
  * Add a plugin hook to the hooks list.
126
133
  *
@@ -129,7 +136,7 @@ declare function checkDedupe<TResolvedConfig extends ResolvedConfig = ResolvedCo
129
136
  * @param pluginHook - The plugin hook to add
130
137
  * @param hooksList - The list of hooks to add to
131
138
  */
132
- declare function addPluginHook<TContext extends PluginContext = PluginContext, TField extends PluginHookFields<TContext> = PluginHookFields<TContext>, TList extends HooksListItem<TContext, TField> = HooksListItem<TContext, TField>>(context: TContext, plugin: Plugin<TContext>, pluginHook: PluginHook<AnyFunction>, hooksList: TList[]): void;
139
+ declare function addPluginHook<TContext extends PluginContext = PluginContext, TField extends PluginHookFields<TContext> = PluginHookFields<TContext>, TList extends HooksListItem<TContext, TField> = HooksListItem<TContext, TField>>(context: TContext, plugin: Plugin<TContext>, pluginHook: PluginHook<AnyFunction>, hooksList: TList[]): TList[];
133
140
  /**
134
141
  * Check the provided {@link PluginConfig}, and return a stringified version of the invalid configuration. If an array is provided, check each item in the array.
135
142
  *
@@ -139,5 +146,5 @@ declare function addPluginHook<TContext extends PluginContext = PluginContext, T
139
146
  declare function findInvalidPluginConfig<TContext extends PluginContext = PluginContext<ResolvedConfig>>(config: PluginConfig<TContext>): string[] | null;
140
147
  declare type __ΩGetHookHandlerReturnType = any[];
141
148
  //#endregion
142
- export { GetHookHandlerReturnType, __ΩGetHookHandlerReturnType, addPluginHook, checkDedupe, extractPluginHook, findInvalidPluginConfig, getHookHandler, isPlugin, isPluginConfig, isPluginConfigObject, isPluginConfigTuple, isPluginHook, isPluginHookField, isPluginHookFunction, isPluginHookObject, isUnpluginHookField, isUnpluginHookKey };
149
+ export { GetHookHandlerReturnType, __ΩGetHookHandlerReturnType, addPluginHook, dedupeHooklist, extractPluginHook, findInvalidPluginConfig, getHookHandler, isDuplicate, isPlugin, isPluginConfig, isPluginConfigObject, isPluginConfigTuple, isPluginHook, isPluginHookField, isPluginHookFunction, isPluginHookObject, isUnpluginHookField, isUnpluginHookKey };
143
150
  //# sourceMappingURL=helpers.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"helpers.d.m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,iCACkB,sBAAA,GAC9B,sBAAA,CAAA,CACF,KAAA,WAAgB,KAAA,IAAS,uBAAA;;AA3F3B;;;;;;iBAyGgB,WAAA,yBACU,cAAA,GAAiB,cAAA,mBACxB,aAAA,CAAc,eAAA,IAC7B,aAAA,CAAc,eAAA,EAAA,CAChB,MAAA,EAAQ,MAAA,CAAO,QAAA,GAAW,OAAA,EAAS,MAAA,CAAO,QAAA;;;;AAzG5C;;;iBA2HgB,cAAA,kBACG,aAAA,GAAgB,aAAA,iBAClB,gBAAA,CAAiB,QAAA,IAAY,gBAAA,CAAiB,QAAA,iBAC/C,aAAA,CAAc,QAAA,EAAU,MAAA,IAAU,aAAA,CAC9C,QAAA,EACA,MAAA,EAAA,CAEF,SAAA,EAAW,KAAA,KAAU,KAAA;;;;;;;;;iBAsBP,aAAA,kBACG,aAAA,GAAgB,aAAA,iBAClB,gBAAA,CAAiB,QAAA,IAAY,gBAAA,CAAiB,QAAA,iBAC/C,aAAA,CAAc,QAAA,EAAU,MAAA,IAAU,aAAA,CAC9C,QAAA,EACA,MAAA,EAAA,CAGF,OAAA,EAAS,QAAA,EACT,MAAA,EAAQ,MAAA,CAAO,QAAA,GACf,UAAA,EAAY,UAAA,CAAW,WAAA,GACvB,SAAA,EAAW,KAAA,KACV,KAAA;;;;;;;iBA6Ba,uBAAA,kBACG,aAAA,GAAgB,aAAA,CAAc,cAAA,EAAA,CAC/C,MAAA,EAAQ,YAAA,CAAa,QAAA;AAAA"}
@@ -124,8 +124,20 @@ function isUnpluginHookField(field) {
124
124
  * @param plugins - The list of plugins to check against
125
125
  * @returns True if the plugin should be deduplicated, false otherwise
126
126
  */
127
- function checkDedupe(plugin, plugins) {
128
- return plugin.dedupe === false || plugins.some((p) => p.dedupe !== false && (isFunction(p.dedupe) && p.dedupe(plugin) || p.name === plugin.name));
127
+ function isDuplicate(plugin, plugins) {
128
+ return plugin.dedupe !== false && plugins.some((p) => p.dedupe !== false && (isFunction(p.dedupe) && p.dedupe(plugin) || p.name.toLowerCase() === plugin.name.toLowerCase()));
129
+ }
130
+ /**
131
+ * Remove duplicate hooks from a list of hooks, keeping the first occurrence of each plugin.
132
+ *
133
+ * @param hooksList - The list of hooks to deduplicate.
134
+ * @returns A new list of hooks with duplicates removed.
135
+ */
136
+ function dedupeHooklist(hooksList) {
137
+ return hooksList.reduce((ret, hook) => {
138
+ if (!isDuplicate(hook.plugin, ret.map((h) => h.plugin))) ret.push(hook);
139
+ return ret;
140
+ }, []);
129
141
  }
130
142
  /**
131
143
  * Add a plugin hook to the hooks list.
@@ -136,14 +148,15 @@ function checkDedupe(plugin, plugins) {
136
148
  * @param hooksList - The list of hooks to add to
137
149
  */
138
150
  function addPluginHook(context, plugin, pluginHook, hooksList) {
139
- if (!checkDedupe(plugin, hooksList.map((hook) => hook.plugin).filter(Boolean))) {
151
+ if (!isDuplicate(plugin, hooksList.map((hook) => hook.plugin).filter(Boolean))) {
140
152
  const handler = ((...args) => getHookHandler(pluginHook).apply(context, args));
141
- if (!handler) return;
153
+ if (!handler) return dedupeHooklist(hooksList);
142
154
  hooksList.push({
143
155
  plugin,
144
156
  handler
145
157
  });
146
158
  }
159
+ return dedupeHooklist(hooksList);
147
160
  }
148
161
  /**
149
162
  * Check the provided {@link PluginConfig}, and return a stringified version of the invalid configuration. If an array is provided, check each item in the array.
@@ -165,5 +178,5 @@ function findInvalidPluginConfig(config) {
165
178
  }
166
179
 
167
180
  //#endregion
168
- export { addPluginHook, checkDedupe, extractPluginHook, findInvalidPluginConfig, getHookHandler, isPlugin, isPluginConfig, isPluginConfigObject, isPluginConfigTuple, isPluginHook, isPluginHookField, isPluginHookFunction, isPluginHookObject, isUnpluginHookField, isUnpluginHookKey };
181
+ export { addPluginHook, dedupeHooklist, extractPluginHook, findInvalidPluginConfig, getHookHandler, isDuplicate, isPlugin, isPluginConfig, isPluginConfigObject, isPluginConfigTuple, isPluginHook, isPluginHookField, isPluginHookFunction, isPluginHookObject, isUnpluginHookField, isUnpluginHookKey };
169
182
  //# sourceMappingURL=helpers.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"helpers.mjs","names":[],"sources":["../../src/plugin-utils/helpers.ts"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Powerlines\n\n This code was released as part of the Powerlines project. Powerlines\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/powerlines.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/powerlines\n Documentation: https://docs.stormsoftware.com/projects/powerlines\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport { isFunction } from \"@stryke/type-checks/is-function\";\nimport { isSetObject } from \"@stryke/type-checks/is-set-object\";\nimport { isSetString } from \"@stryke/type-checks/is-set-string\";\nimport { isUndefined } from \"@stryke/type-checks/is-undefined\";\nimport { AnyFunction } from \"@stryke/types/base\";\nimport {\n PLUGIN_HOOKS_FIELDS,\n PLUGIN_NON_HOOK_FIELDS,\n UNPLUGIN_BUILDER_VARIANTS\n} from \"../constants/plugin\";\nimport type {\n PluginConfig,\n PluginConfigObject,\n PluginConfigTuple,\n ResolvedConfig\n} from \"../types/config\";\nimport type { PluginContext, WithUnpluginBuildContext } from \"../types/context\";\nimport type { HooksListItem } from \"../types/hooks\";\nimport type {\n Plugin,\n PluginHook,\n PluginHookFields,\n PluginHookObject,\n PluginHooks\n} from \"../types/plugin\";\nimport type {\n UnpluginBuilderVariant,\n UnpluginOptions\n} from \"../types/unplugin\";\n\n/**\n * Type guard to check if an object is a {@link Plugin}\n *\n * @param value - The object to check\n * @returns True if the object is a {@link Plugin}, false otherwise\n */\nexport function isPlugin<\n TContext extends PluginContext = PluginContext<ResolvedConfig>\n>(value: unknown): value is Plugin<TContext> {\n return (\n isSetObject(value) &&\n \"name\" in value &&\n isSetString(value.name) &&\n (isUndefined((value as Plugin<TContext>).api) ||\n (\"api\" in value && isSetObject(value.api))) &&\n (isUndefined((value as Plugin<TContext>).applyToEnvironment) ||\n (\"applyToEnvironment\" in value &&\n isFunction(value.applyToEnvironment))) &&\n (isUndefined((value as Plugin<TContext>).dedupe) ||\n (\"dedupe\" in value && isFunction(value.dedupe))) &&\n PLUGIN_HOOKS_FIELDS.every(\n hook =>\n isUndefined((value as Plugin<TContext>)[hook]) ||\n (hook in value &&\n (isPluginHookFunction((value as Plugin<TContext>)[hook]) ||\n (hook === \"config\" &&\n isSetObject((value as Plugin<TContext>)[hook]))))\n )\n );\n}\n\n/**\n * Type guard to check if an object is a {@link PluginConfigObject}\n *\n * @param value - The object to check\n * @returns True if the object is a {@link PluginConfigObject}, false otherwise\n */\nexport function isPluginConfigObject<\n TContext extends PluginContext = PluginContext<ResolvedConfig>\n>(value: unknown): value is PluginConfigObject<TContext> {\n return (\n isSetObject(value) &&\n \"plugin\" in value &&\n (((isSetString(value.plugin) || isFunction(value.plugin)) &&\n \"options\" in value &&\n isSetObject(value.options)) ||\n isPlugin(value.plugin))\n );\n}\n\n/**\n * Type guard to check if an object is a {@link PluginConfigTuple}\n *\n * @param value - The object to check\n * @returns True if the object is a {@link PluginConfigTuple}, false otherwise\n */\nexport function isPluginConfigTuple<\n TContext extends PluginContext = PluginContext<ResolvedConfig>\n>(value: unknown): value is PluginConfigTuple<TContext> {\n return (\n Array.isArray(value) &&\n (value.length === 1 || value.length === 2) &&\n (((isSetString(value[0]) || isFunction(value[0])) &&\n value.length > 1 &&\n isSetObject(value[1])) ||\n isPlugin(value[0]))\n );\n}\n\n/**\n * Type guard to check if an object is a {@link PluginConfig}\n *\n * @param value - The object to check\n * @returns True if the object is a {@link PluginConfig}, false otherwise\n */\nexport function isPluginConfig<\n TContext extends PluginContext = PluginContext<ResolvedConfig>\n>(value: unknown): value is PluginConfig<TContext> {\n return (\n isSetString(value) ||\n isFunction(value) ||\n isPlugin<TContext>(value) ||\n isPluginConfigObject(value) ||\n isPluginConfigTuple(value) ||\n (Array.isArray(value) && value.every(item => isPluginConfig(item)))\n );\n}\n\n/**\n * Type guard to check if an value is a {@link PluginHook} function\n *\n * @param value - The value to check\n * @returns True if the value is a {@link PluginHook} function, false otherwise\n */\nexport function isPluginHookObject(\n value: unknown\n): value is PluginHookObject<AnyFunction> {\n return isSetObject(value) && \"handler\" in value && isFunction(value.handler);\n}\n\n/**\n * Type guard to check if an value is a {@link PluginHook} function\n *\n * @param value - The value to check\n * @returns True if the value is a {@link PluginHook} function, false otherwise\n */\nexport function isPluginHookFunction(value: unknown): value is AnyFunction {\n return isFunction(value) || isPluginHookObject(value);\n}\n\n/**\n * Type guard to check if an object is a {@link PluginHook}\n *\n * @param value - The object to check\n * @returns True if the object is a {@link PluginHook}, false otherwise\n */\nexport function isPluginHook(value: unknown): value is PluginHook<AnyFunction> {\n return isPluginHookFunction(value) || isPluginHookObject(value);\n}\n\nexport type GetHookHandlerReturnType<\n TContext extends PluginContext = PluginContext,\n TField extends string = string\n> = HooksListItem<TContext, TField>[\"handler\"];\n\n/**\n * Extract the hook handler function from a plugin hook\n *\n * @param pluginHook - The plugin hook to extract the handler function from\n * @returns The hook handler function\n */\nexport function getHookHandler<\n TContext extends PluginContext = PluginContext,\n TKey extends string = string\n>(\n pluginHook: PluginHook<AnyFunction>\n): GetHookHandlerReturnType<TContext, TKey> {\n return (\n isFunction(pluginHook) ? pluginHook : pluginHook.handler\n ) as GetHookHandlerReturnType<TContext, TKey>;\n}\n\n/**\n * Extract a plugin hook from a plugin\n *\n * @param context - The build context\n * @param plugin - The plugin to extract the hook from\n * @param hook - The name of the hook to extract\n * @returns The extracted hook, or undefined if the hook does not exist\n */\nexport function extractPluginHook<\n TContext extends PluginContext = PluginContext,\n TPlugin extends Plugin<TContext> = Plugin<TContext>\n>(context: TContext, plugin: TPlugin, hook: keyof PluginHooks<TContext>) {\n const pluginHook = plugin[hook];\n if (!isPluginHook(pluginHook)) {\n return undefined;\n }\n\n return isFunction(pluginHook)\n ? {\n normal: pluginHook.bind(context)\n }\n : {\n [pluginHook.order ? pluginHook.order : \"normal\"]:\n pluginHook.handler.bind(context)\n };\n}\n\n/**\n * Check if a hook is external.\n *\n * @param keys - The name of the hook to check.\n * @returns True if the hook is external, false otherwise.\n */\nexport function isUnpluginHookKey<\n TUnpluginBuilderVariant extends UnpluginBuilderVariant =\n UnpluginBuilderVariant\n>(\n keys: string\n): keys is `${TUnpluginBuilderVariant}:${keyof UnpluginOptions[TUnpluginBuilderVariant] & string}` {\n return UNPLUGIN_BUILDER_VARIANTS.some(variant =>\n keys.startsWith(`${variant}:`)\n );\n}\n\n/**\n * Check if a hook is internal.\n *\n * @param keys - The name of the hook to check.\n * @returns True if the hook is external, false otherwise.\n */\nexport function isPluginHookField<TContext extends PluginContext>(\n keys: string\n) {\n return !PLUGIN_NON_HOOK_FIELDS.includes(keys as PluginHookFields<TContext>);\n}\n\n/**\n * Check if a hook is external.\n *\n * @param field - The name of the hook to check.\n * @returns True if the hook is external, false otherwise.\n */\nexport function isUnpluginHookField<\n TUnpluginBuilderVariant extends UnpluginBuilderVariant =\n UnpluginBuilderVariant\n>(field: string): field is TUnpluginBuilderVariant {\n return (\n !isPluginHookField(field) &&\n UNPLUGIN_BUILDER_VARIANTS.includes(field as UnpluginBuilderVariant)\n );\n}\n\n/**\n * Check if a plugin should be deduplicated.\n *\n * @param plugin - The plugin to check\n * @param plugins - The list of plugins to check against\n * @returns True if the plugin should be deduplicated, false otherwise\n */\nexport function checkDedupe<\n TResolvedConfig extends ResolvedConfig = ResolvedConfig,\n TContext extends PluginContext<TResolvedConfig> =\n PluginContext<TResolvedConfig>\n>(plugin: Plugin<TContext>, plugins: Plugin<TContext>[]) {\n return (\n plugin.dedupe === false ||\n plugins.some(\n p =>\n p.dedupe !== false &&\n ((isFunction(p.dedupe) && p.dedupe(plugin)) || p.name === plugin.name)\n )\n );\n}\n\n/**\n * Add a plugin hook to the hooks list.\n *\n * @param context - The plugin context\n * @param plugin - The plugin to add the hook from\n * @param pluginHook - The plugin hook to add\n * @param hooksList - The list of hooks to add to\n */\nexport function addPluginHook<\n TContext extends PluginContext = PluginContext,\n TField extends PluginHookFields<TContext> = PluginHookFields<TContext>,\n TList extends HooksListItem<TContext, TField> = HooksListItem<\n TContext,\n TField\n >\n>(\n context: TContext,\n plugin: Plugin<TContext>,\n pluginHook: PluginHook<AnyFunction>,\n hooksList: TList[]\n) {\n if (\n !checkDedupe(plugin, hooksList.map(hook => hook.plugin).filter(Boolean))\n ) {\n const handler = ((...args: unknown[]) =>\n (\n getHookHandler<WithUnpluginBuildContext<TContext>, TField>(\n pluginHook\n ) as unknown as (...args: unknown[]) => unknown\n ).apply(context, args)) as GetHookHandlerReturnType<TContext, TField>;\n if (!handler) {\n return;\n }\n\n hooksList.push({\n plugin,\n handler\n } as any);\n }\n}\n\n/**\n * Check the provided {@link PluginConfig}, and return a stringified version of the invalid configuration. If an array is provided, check each item in the array.\n *\n * @param config - The plugin configuration to check\n * @returns Null if the configuration is valid, otherwise an array of stringified invalid configurations\n */\nexport function findInvalidPluginConfig<\n TContext extends PluginContext = PluginContext<ResolvedConfig>\n>(config: PluginConfig<TContext>): string[] | null {\n if (isPluginConfig<TContext>(config)) {\n return null;\n }\n\n if (Array.isArray(config as PluginConfig<TContext>[])) {\n const invalidItems: string[] = [];\n (config as PluginConfig<TContext>[]).forEach(item => {\n const invalid = findInvalidPluginConfig<TContext>(item);\n if (invalid) {\n invalidItems.push(...invalid.map(i => JSON.stringify(i, null, 2)));\n }\n });\n\n return invalidItems.length > 0 ? invalidItems : null;\n }\n\n return [JSON.stringify(config, null, 2)];\n}\n"],"mappings":";;;;;;;;;;;;;AAsDA,SAAgB,SAEd,OAA2C;AAC3C,QACE,YAAY,MAAM,IAClB,UAAU,SACV,YAAY,MAAM,KAAK,KACtB,YAAa,MAA2B,IAAI,IAC1C,SAAS,SAAS,YAAY,MAAM,IAAI,MAC1C,YAAa,MAA2B,mBAAmB,IACzD,wBAAwB,SACvB,WAAW,MAAM,mBAAmB,MAC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AC,KAAK,UAAU,QAAQ,MAAM,EAAE,CAAC"}
1
+ {"version":3,"file":"helpers.mjs","names":[],"sources":["../../src/plugin-utils/helpers.ts"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Powerlines\n\n This code was released as part of the Powerlines project. Powerlines\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/powerlines.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/powerlines\n Documentation: https://docs.stormsoftware.com/projects/powerlines\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport { isFunction } from \"@stryke/type-checks/is-function\";\nimport { isSetObject } from \"@stryke/type-checks/is-set-object\";\nimport { isSetString } from \"@stryke/type-checks/is-set-string\";\nimport { isUndefined } from \"@stryke/type-checks/is-undefined\";\nimport { AnyFunction } from \"@stryke/types/base\";\nimport {\n PLUGIN_HOOKS_FIELDS,\n PLUGIN_NON_HOOK_FIELDS,\n UNPLUGIN_BUILDER_VARIANTS\n} from \"../constants/plugin\";\nimport type {\n PluginConfig,\n PluginConfigObject,\n PluginConfigTuple,\n ResolvedConfig\n} from \"../types/config\";\nimport type { PluginContext, WithUnpluginBuildContext } from \"../types/context\";\nimport type { HooksListItem } from \"../types/hooks\";\nimport type {\n Plugin,\n PluginHook,\n PluginHookFields,\n PluginHookObject,\n PluginHooks\n} from \"../types/plugin\";\nimport type {\n UnpluginBuilderVariant,\n UnpluginOptions\n} from \"../types/unplugin\";\n\n/**\n * Type guard to check if an object is a {@link Plugin}\n *\n * @param value - The object to check\n * @returns True if the object is a {@link Plugin}, false otherwise\n */\nexport function isPlugin<\n TContext extends PluginContext = PluginContext<ResolvedConfig>\n>(value: unknown): value is Plugin<TContext> {\n return (\n isSetObject(value) &&\n \"name\" in value &&\n isSetString(value.name) &&\n (isUndefined((value as Plugin<TContext>).api) ||\n (\"api\" in value && isSetObject(value.api))) &&\n (isUndefined((value as Plugin<TContext>).applyToEnvironment) ||\n (\"applyToEnvironment\" in value &&\n isFunction(value.applyToEnvironment))) &&\n (isUndefined((value as Plugin<TContext>).dedupe) ||\n (\"dedupe\" in value && isFunction(value.dedupe))) &&\n PLUGIN_HOOKS_FIELDS.every(\n hook =>\n isUndefined((value as Plugin<TContext>)[hook]) ||\n (hook in value &&\n (isPluginHookFunction((value as Plugin<TContext>)[hook]) ||\n (hook === \"config\" &&\n isSetObject((value as Plugin<TContext>)[hook]))))\n )\n );\n}\n\n/**\n * Type guard to check if an object is a {@link PluginConfigObject}\n *\n * @param value - The object to check\n * @returns True if the object is a {@link PluginConfigObject}, false otherwise\n */\nexport function isPluginConfigObject<\n TContext extends PluginContext = PluginContext<ResolvedConfig>\n>(value: unknown): value is PluginConfigObject<TContext> {\n return (\n isSetObject(value) &&\n \"plugin\" in value &&\n (((isSetString(value.plugin) || isFunction(value.plugin)) &&\n \"options\" in value &&\n isSetObject(value.options)) ||\n isPlugin(value.plugin))\n );\n}\n\n/**\n * Type guard to check if an object is a {@link PluginConfigTuple}\n *\n * @param value - The object to check\n * @returns True if the object is a {@link PluginConfigTuple}, false otherwise\n */\nexport function isPluginConfigTuple<\n TContext extends PluginContext = PluginContext<ResolvedConfig>\n>(value: unknown): value is PluginConfigTuple<TContext> {\n return (\n Array.isArray(value) &&\n (value.length === 1 || value.length === 2) &&\n (((isSetString(value[0]) || isFunction(value[0])) &&\n value.length > 1 &&\n isSetObject(value[1])) ||\n isPlugin(value[0]))\n );\n}\n\n/**\n * Type guard to check if an object is a {@link PluginConfig}\n *\n * @param value - The object to check\n * @returns True if the object is a {@link PluginConfig}, false otherwise\n */\nexport function isPluginConfig<\n TContext extends PluginContext = PluginContext<ResolvedConfig>\n>(value: unknown): value is PluginConfig<TContext> {\n return (\n isSetString(value) ||\n isFunction(value) ||\n isPlugin<TContext>(value) ||\n isPluginConfigObject(value) ||\n isPluginConfigTuple(value) ||\n (Array.isArray(value) && value.every(item => isPluginConfig(item)))\n );\n}\n\n/**\n * Type guard to check if an value is a {@link PluginHook} function\n *\n * @param value - The value to check\n * @returns True if the value is a {@link PluginHook} function, false otherwise\n */\nexport function isPluginHookObject(\n value: unknown\n): value is PluginHookObject<AnyFunction> {\n return isSetObject(value) && \"handler\" in value && isFunction(value.handler);\n}\n\n/**\n * Type guard to check if an value is a {@link PluginHook} function\n *\n * @param value - The value to check\n * @returns True if the value is a {@link PluginHook} function, false otherwise\n */\nexport function isPluginHookFunction(value: unknown): value is AnyFunction {\n return isFunction(value) || isPluginHookObject(value);\n}\n\n/**\n * Type guard to check if an object is a {@link PluginHook}\n *\n * @param value - The object to check\n * @returns True if the object is a {@link PluginHook}, false otherwise\n */\nexport function isPluginHook(value: unknown): value is PluginHook<AnyFunction> {\n return isPluginHookFunction(value) || isPluginHookObject(value);\n}\n\nexport type GetHookHandlerReturnType<\n TContext extends PluginContext = PluginContext,\n TField extends string = string\n> = HooksListItem<TContext, TField>[\"handler\"];\n\n/**\n * Extract the hook handler function from a plugin hook\n *\n * @param pluginHook - The plugin hook to extract the handler function from\n * @returns The hook handler function\n */\nexport function getHookHandler<\n TContext extends PluginContext = PluginContext,\n TKey extends string = string\n>(\n pluginHook: PluginHook<AnyFunction>\n): GetHookHandlerReturnType<TContext, TKey> {\n return (\n isFunction(pluginHook) ? pluginHook : pluginHook.handler\n ) as GetHookHandlerReturnType<TContext, TKey>;\n}\n\n/**\n * Extract a plugin hook from a plugin\n *\n * @param context - The build context\n * @param plugin - The plugin to extract the hook from\n * @param hook - The name of the hook to extract\n * @returns The extracted hook, or undefined if the hook does not exist\n */\nexport function extractPluginHook<\n TContext extends PluginContext = PluginContext,\n TPlugin extends Plugin<TContext> = Plugin<TContext>\n>(context: TContext, plugin: TPlugin, hook: keyof PluginHooks<TContext>) {\n const pluginHook = plugin[hook];\n if (!isPluginHook(pluginHook)) {\n return undefined;\n }\n\n return isFunction(pluginHook)\n ? {\n normal: pluginHook.bind(context)\n }\n : {\n [pluginHook.order ? pluginHook.order : \"normal\"]:\n pluginHook.handler.bind(context)\n };\n}\n\n/**\n * Check if a hook is external.\n *\n * @param keys - The name of the hook to check.\n * @returns True if the hook is external, false otherwise.\n */\nexport function isUnpluginHookKey<\n TUnpluginBuilderVariant extends UnpluginBuilderVariant =\n UnpluginBuilderVariant\n>(\n keys: string\n): keys is `${TUnpluginBuilderVariant}:${keyof UnpluginOptions[TUnpluginBuilderVariant] & string}` {\n return UNPLUGIN_BUILDER_VARIANTS.some(variant =>\n keys.startsWith(`${variant}:`)\n );\n}\n\n/**\n * Check if a hook is internal.\n *\n * @param keys - The name of the hook to check.\n * @returns True if the hook is external, false otherwise.\n */\nexport function isPluginHookField<TContext extends PluginContext>(\n keys: string\n) {\n return !PLUGIN_NON_HOOK_FIELDS.includes(keys as PluginHookFields<TContext>);\n}\n\n/**\n * Check if a hook is external.\n *\n * @param field - The name of the hook to check.\n * @returns True if the hook is external, false otherwise.\n */\nexport function isUnpluginHookField<\n TUnpluginBuilderVariant extends UnpluginBuilderVariant =\n UnpluginBuilderVariant\n>(field: string): field is TUnpluginBuilderVariant {\n return (\n !isPluginHookField(field) &&\n UNPLUGIN_BUILDER_VARIANTS.includes(field as UnpluginBuilderVariant)\n );\n}\n\n/**\n * Check if a plugin should be deduplicated.\n *\n * @param plugin - The plugin to check\n * @param plugins - The list of plugins to check against\n * @returns True if the plugin should be deduplicated, false otherwise\n */\nexport function isDuplicate<\n TResolvedConfig extends ResolvedConfig = ResolvedConfig,\n TContext extends PluginContext<TResolvedConfig> =\n PluginContext<TResolvedConfig>\n>(plugin: Plugin<TContext>, plugins: Plugin<TContext>[]) {\n return (\n plugin.dedupe !== false &&\n plugins.some(\n p =>\n p.dedupe !== false &&\n ((isFunction(p.dedupe) && p.dedupe(plugin)) ||\n p.name.toLowerCase() === plugin.name.toLowerCase())\n )\n );\n}\n\n/**\n * Remove duplicate hooks from a list of hooks, keeping the first occurrence of each plugin.\n *\n * @param hooksList - The list of hooks to deduplicate.\n * @returns A new list of hooks with duplicates removed.\n */\nexport function dedupeHooklist<\n TContext extends PluginContext = PluginContext,\n TField extends PluginHookFields<TContext> = PluginHookFields<TContext>,\n TList extends HooksListItem<TContext, TField> = HooksListItem<\n TContext,\n TField\n >\n>(hooksList: TList[]): TList[] {\n return hooksList.reduce<TList[]>((ret, hook) => {\n if (\n !isDuplicate(\n hook.plugin,\n ret.map(h => h.plugin)\n )\n ) {\n ret.push(hook);\n }\n return ret;\n }, []);\n}\n\n/**\n * Add a plugin hook to the hooks list.\n *\n * @param context - The plugin context\n * @param plugin - The plugin to add the hook from\n * @param pluginHook - The plugin hook to add\n * @param hooksList - The list of hooks to add to\n */\nexport function addPluginHook<\n TContext extends PluginContext = PluginContext,\n TField extends PluginHookFields<TContext> = PluginHookFields<TContext>,\n TList extends HooksListItem<TContext, TField> = HooksListItem<\n TContext,\n TField\n >\n>(\n context: TContext,\n plugin: Plugin<TContext>,\n pluginHook: PluginHook<AnyFunction>,\n hooksList: TList[]\n): TList[] {\n if (\n !isDuplicate(plugin, hooksList.map(hook => hook.plugin).filter(Boolean))\n ) {\n const handler = ((...args: unknown[]) =>\n (\n getHookHandler<WithUnpluginBuildContext<TContext>, TField>(\n pluginHook\n ) as unknown as (...args: unknown[]) => unknown\n ).apply(context, args)) as GetHookHandlerReturnType<TContext, TField>;\n if (!handler) {\n return dedupeHooklist<TContext, TField, TList>(hooksList);\n }\n\n hooksList.push({\n plugin,\n handler\n } as any);\n }\n\n return dedupeHooklist<TContext, TField, TList>(hooksList);\n}\n\n/**\n * Check the provided {@link PluginConfig}, and return a stringified version of the invalid configuration. If an array is provided, check each item in the array.\n *\n * @param config - The plugin configuration to check\n * @returns Null if the configuration is valid, otherwise an array of stringified invalid configurations\n */\nexport function findInvalidPluginConfig<\n TContext extends PluginContext = PluginContext<ResolvedConfig>\n>(config: PluginConfig<TContext>): string[] | null {\n if (isPluginConfig<TContext>(config)) {\n return null;\n }\n\n if (Array.isArray(config as PluginConfig<TContext>[])) {\n const invalidItems: string[] = [];\n (config as PluginConfig<TContext>[]).forEach(item => {\n const invalid = findInvalidPluginConfig<TContext>(item);\n if (invalid) {\n invalidItems.push(...invalid.map(i => JSON.stringify(i, null, 2)));\n }\n });\n\n return invalidItems.length > 0 ? invalidItems : null;\n }\n\n return [JSON.stringify(config, null, 2)];\n}\n"],"mappings":";;;;;;;;;;;;;AAsDA,SAAgB,SAEd,OAA2C;AAC3C,QACE,YAAY,MAAM,IAClB,UAAU,SACV,YAAY,MAAM,KAAK,KACtB,YAAa,MAA2B,IAAI,IAC1C,SAAS,SAAS,YAAY,MAAM,IAAI,MAC1C,YAAa,MAA2B,mBAAmB,IACzD,wBAAwB,SACvB,WAAW,MAAM,mBAAmB,MACvC,YAAa,MAA2B,OAAO,IAC7C,YAAY,SAAS,WAAW,MAAM,OAAO,KAChD,oBAAoB,OAClB,SACE,YAAa,MAA2B,MAAM,IAC7C,QAAQ,UACN,qBAAsB,MAA2B,MAAM,IACrD,SAAS,YACR,YAAa,MAA2B,MAAM,EACvD;;;;;;;;AAUL,SAAgB,qBAEd,OAAuD;AACvD,QACE,YAAY,MAAM,IAClB,YAAY,WACT,YAAY,MAAM,OAAO,IAAI,WAAW,MAAM,OAAO,KACtD,aAAa,SACb,YAAY,MAAM,QAAQ,IAC1B,SAAS,MAAM,OAAO;;;;;;;;AAU5B,SAAgB,oBAEd,OAAsD;AACtD,QACE,MAAM,QAAQ,MAAM,KACnB,MAAM,WAAW,KAAK,MAAM,WAAW,QACrC,YAAY,MAAM,GAAG,IAAI,WAAW,MAAM,GAAG,KAC9C,MAAM,SAAS,KACf,YAAY,MAAM,GAAG,IACrB,SAAS,MAAM,GAAG;;;;;;;;AAUxB,SAAgB,eAEd,OAAiD;AACjD,QACE,YAAY,MAAM,IAClB,WAAW,MAAM,IACjB,SAAmB,MAAM,IACzB,qBAAqB,MAAM,IAC3B,oBAAoB,MAAM,IACzB,MAAM,QAAQ,MAAM,IAAI,MAA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E,OAAO,CACvB,CAED,KAAI,KAAK,KAAK;AAEhB,SAAO;IACN,EAAE,CAAC;;;;;;;;;;AAWR,SAAgB,cAQd,SACA,QACA,YACA,WACS;AACT,KACE,CAAC,YAAY,QAAQ,UAAU,KAAI,SAAQ,KAAK,OAAO,CAAC,OAAO,QAAQ,CAAC,EACxE;EACA,MAAM,YAAY,GAAG,SAEjB,eACE,WACD,CACD,MAAM,SAAS,KAAK;AACxB,MAAI,CAAC,QACH,QAAO,eAAwC,UAAU;AAG3D,YAAU,KAAK;GACb;GACA;GACD,CAAQ;;AAGX,QAAO,eAAwC,UAAU;;;;;;;;AAS3D,SAAgB,wBAEd,QAAiD;AACjD,KAAI,eAAyB,OAAO,CAClC,QAAO;AAGT,KAAI,MAAM,QAAQ,OAAmC,EAAE;EACrD,MAAM,eAAyB,EAAE;AACjC,EAAC,OAAoC,SAAQ,SAAQ;GACnD,MAAM,UAAU,wBAAkC,KAAK;AACvD,OAAI,QACF,cAAa,KAAK,GAAG,QAAQ,KAAI,MAAK,KAAK,UAAU,GAAG,MAAM,EAAE,CAAC,CAAC;IAEpE;AAEF,SAAO,aAAa,SAAS,IAAI,eAAe;;AAGlD,QAAO,CAAC,KAAK,UAAU,QAAQ,MAAM,EAAE,CAAC"}
@@ -11,9 +11,9 @@ const require_plugin_utils_get_config_path = require('./get-config-path.cjs');
11
11
  const require_plugin_utils_modules = require('./modules.cjs');
12
12
 
13
13
  exports.addPluginHook = require_plugin_utils_helpers.addPluginHook;
14
- exports.checkDedupe = require_plugin_utils_helpers.checkDedupe;
15
14
  exports.combinePluginOptions = require_plugin_utils_combine_plugins.combinePluginOptions;
16
15
  exports.combinePlugins = require_plugin_utils_combine_plugins.combinePlugins;
16
+ exports.dedupeHooklist = require_plugin_utils_helpers.dedupeHooklist;
17
17
  exports.extend = require_plugin_utils_extend.extend;
18
18
  exports.extractPluginHook = require_plugin_utils_helpers.extractPluginHook;
19
19
  exports.findInvalidPluginConfig = require_plugin_utils_helpers.findInvalidPluginConfig;
@@ -24,6 +24,7 @@ exports.getHookHandler = require_plugin_utils_helpers.getHookHandler;
24
24
  exports.getOrganizationName = require_plugin_utils_context_helpers.getOrganizationName;
25
25
  exports.getWorkspaceName = require_plugin_utils_context_helpers.getWorkspaceName;
26
26
  exports.isBuiltinModule = require_plugin_utils_modules.isBuiltinModule;
27
+ exports.isDuplicate = require_plugin_utils_helpers.isDuplicate;
27
28
  exports.isPlugin = require_plugin_utils_helpers.isPlugin;
28
29
  exports.isPluginConfig = require_plugin_utils_helpers.isPluginConfig;
29
30
  exports.isPluginConfigObject = require_plugin_utils_helpers.isPluginConfigObject;
@@ -4,8 +4,8 @@ import { getOrganizationName, getWorkspaceName } from "./context-helpers.cjs";
4
4
  import { extend } from "./extend.cjs";
5
5
  import { formatPackageJson } from "./format-package-json.cjs";
6
6
  import { getConfigPath } from "./get-config-path.cjs";
7
- import { GetHookHandlerReturnType, __ΩGetHookHandlerReturnType, addPluginHook, checkDedupe, extractPluginHook, findInvalidPluginConfig, getHookHandler, isPlugin, isPluginConfig, isPluginConfigObject, isPluginConfigTuple, isPluginHook, isPluginHookField, isPluginHookFunction, isPluginHookObject, isUnpluginHookField, isUnpluginHookKey } from "./helpers.cjs";
7
+ import { GetHookHandlerReturnType, __ΩGetHookHandlerReturnType, addPluginHook, dedupeHooklist, extractPluginHook, findInvalidPluginConfig, getHookHandler, isDuplicate, isPlugin, isPluginConfig, isPluginConfigObject, isPluginConfigTuple, isPluginHook, isPluginHookField, isPluginHookFunction, isPluginHookObject, isUnpluginHookField, isUnpluginHookKey } from "./helpers.cjs";
8
8
  import { MergeResult, __ΩMergeResult, merge, mergeConfig } from "./merge.cjs";
9
9
  import { isBuiltinModule } from "./modules.cjs";
10
10
  import { replacePathTokens } from "./paths.cjs";
11
- export { CombinePluginsOptions, GetDependencyConfigResult, GetHookHandlerReturnType, MergeResult, __ΩCombinePluginsOptions, __ΩGetDependencyConfigResult, __ΩGetHookHandlerReturnType, __ΩMergeResult, addPluginHook, checkDedupe, combinePluginOptions, combinePlugins, extend, extractPluginHook, findInvalidPluginConfig, formatPackageJson, getConfigPath, getDependencyConfig, getHookHandler, getOrganizationName, getWorkspaceName, isBuiltinModule, isPlugin, isPluginConfig, isPluginConfigObject, isPluginConfigTuple, isPluginHook, isPluginHookField, isPluginHookFunction, isPluginHookObject, isUnpluginHookField, isUnpluginHookKey, merge, mergeConfig, replacePathTokens };
11
+ export { CombinePluginsOptions, GetDependencyConfigResult, GetHookHandlerReturnType, MergeResult, __ΩCombinePluginsOptions, __ΩGetDependencyConfigResult, __ΩGetHookHandlerReturnType, __ΩMergeResult, addPluginHook, combinePluginOptions, combinePlugins, dedupeHooklist, extend, extractPluginHook, findInvalidPluginConfig, formatPackageJson, getConfigPath, getDependencyConfig, getHookHandler, getOrganizationName, getWorkspaceName, isBuiltinModule, isDuplicate, isPlugin, isPluginConfig, isPluginConfigObject, isPluginConfigTuple, isPluginHook, isPluginHookField, isPluginHookFunction, isPluginHookObject, isUnpluginHookField, isUnpluginHookKey, merge, mergeConfig, replacePathTokens };
@@ -4,8 +4,8 @@ import { getOrganizationName, getWorkspaceName } from "./context-helpers.mjs";
4
4
  import { extend } from "./extend.mjs";
5
5
  import { formatPackageJson } from "./format-package-json.mjs";
6
6
  import { getConfigPath } from "./get-config-path.mjs";
7
- import { GetHookHandlerReturnType, __ΩGetHookHandlerReturnType, addPluginHook, checkDedupe, extractPluginHook, findInvalidPluginConfig, getHookHandler, isPlugin, isPluginConfig, isPluginConfigObject, isPluginConfigTuple, isPluginHook, isPluginHookField, isPluginHookFunction, isPluginHookObject, isUnpluginHookField, isUnpluginHookKey } from "./helpers.mjs";
7
+ import { GetHookHandlerReturnType, __ΩGetHookHandlerReturnType, addPluginHook, dedupeHooklist, extractPluginHook, findInvalidPluginConfig, getHookHandler, isDuplicate, isPlugin, isPluginConfig, isPluginConfigObject, isPluginConfigTuple, isPluginHook, isPluginHookField, isPluginHookFunction, isPluginHookObject, isUnpluginHookField, isUnpluginHookKey } from "./helpers.mjs";
8
8
  import { MergeResult, __ΩMergeResult, merge, mergeConfig } from "./merge.mjs";
9
9
  import { isBuiltinModule } from "./modules.mjs";
10
10
  import { replacePathTokens } from "./paths.mjs";
11
- export { CombinePluginsOptions, GetDependencyConfigResult, GetHookHandlerReturnType, MergeResult, __ΩCombinePluginsOptions, __ΩGetDependencyConfigResult, __ΩGetHookHandlerReturnType, __ΩMergeResult, addPluginHook, checkDedupe, combinePluginOptions, combinePlugins, extend, extractPluginHook, findInvalidPluginConfig, formatPackageJson, getConfigPath, getDependencyConfig, getHookHandler, getOrganizationName, getWorkspaceName, isBuiltinModule, isPlugin, isPluginConfig, isPluginConfigObject, isPluginConfigTuple, isPluginHook, isPluginHookField, isPluginHookFunction, isPluginHookObject, isUnpluginHookField, isUnpluginHookKey, merge, mergeConfig, replacePathTokens };
11
+ export { CombinePluginsOptions, GetDependencyConfigResult, GetHookHandlerReturnType, MergeResult, __ΩCombinePluginsOptions, __ΩGetDependencyConfigResult, __ΩGetHookHandlerReturnType, __ΩMergeResult, addPluginHook, combinePluginOptions, combinePlugins, dedupeHooklist, extend, extractPluginHook, findInvalidPluginConfig, formatPackageJson, getConfigPath, getDependencyConfig, getHookHandler, getOrganizationName, getWorkspaceName, isBuiltinModule, isDuplicate, isPlugin, isPluginConfig, isPluginConfigObject, isPluginConfigTuple, isPluginHook, isPluginHookField, isPluginHookFunction, isPluginHookObject, isUnpluginHookField, isUnpluginHookKey, merge, mergeConfig, replacePathTokens };
@@ -1,7 +1,7 @@
1
1
  import { replacePathTokens } from "./paths.mjs";
2
2
  import { formatPackageJson } from "./format-package-json.mjs";
3
3
  import { getDependencyConfig } from "./build-helpers.mjs";
4
- import { addPluginHook, checkDedupe, extractPluginHook, findInvalidPluginConfig, getHookHandler, isPlugin, isPluginConfig, isPluginConfigObject, isPluginConfigTuple, isPluginHook, isPluginHookField, isPluginHookFunction, isPluginHookObject, isUnpluginHookField, isUnpluginHookKey } from "./helpers.mjs";
4
+ import { addPluginHook, dedupeHooklist, extractPluginHook, findInvalidPluginConfig, getHookHandler, isDuplicate, isPlugin, isPluginConfig, isPluginConfigObject, isPluginConfigTuple, isPluginHook, isPluginHookField, isPluginHookFunction, isPluginHookObject, isUnpluginHookField, isUnpluginHookKey } from "./helpers.mjs";
5
5
  import { merge, mergeConfig } from "./merge.mjs";
6
6
  import { combinePluginOptions, combinePlugins } from "./combine-plugins.mjs";
7
7
  import { getOrganizationName, getWorkspaceName } from "./context-helpers.mjs";
@@ -9,4 +9,4 @@ import { extend } from "./extend.mjs";
9
9
  import { getConfigPath } from "./get-config-path.mjs";
10
10
  import { isBuiltinModule } from "./modules.mjs";
11
11
 
12
- export { addPluginHook, checkDedupe, combinePluginOptions, combinePlugins, extend, extractPluginHook, findInvalidPluginConfig, formatPackageJson, getConfigPath, getDependencyConfig, getHookHandler, getOrganizationName, getWorkspaceName, isBuiltinModule, isPlugin, isPluginConfig, isPluginConfigObject, isPluginConfigTuple, isPluginHook, isPluginHookField, isPluginHookFunction, isPluginHookObject, isUnpluginHookField, isUnpluginHookKey, merge, mergeConfig, replacePathTokens };
12
+ export { addPluginHook, combinePluginOptions, combinePlugins, dedupeHooklist, extend, extractPluginHook, findInvalidPluginConfig, formatPackageJson, getConfigPath, getDependencyConfig, getHookHandler, getOrganizationName, getWorkspaceName, isBuiltinModule, isDuplicate, isPlugin, isPluginConfig, isPluginConfigObject, isPluginConfigTuple, isPluginHook, isPluginHookField, isPluginHookFunction, isPluginHookObject, isUnpluginHookField, isUnpluginHookKey, merge, mergeConfig, replacePathTokens };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@powerlines/core",
3
- "version": "0.13.4",
3
+ "version": "0.13.6",
4
4
  "private": false,
5
5
  "description": "An internal core package for Powerlines - please use the `powerlines` package for public usage.",
6
6
  "homepage": "https://stormsoftware.com",
@@ -493,8 +493,8 @@
493
493
  "types": "./dist/index.d.cts",
494
494
  "files": ["dist/**/*", "files/**/*", "schemas/**/*"],
495
495
  "dependencies": {
496
- "@storm-software/config": "^1.137.26",
497
- "@storm-software/config-tools": "^1.189.72",
496
+ "@storm-software/config": "^1.137.28",
497
+ "@storm-software/config-tools": "^1.189.74",
498
498
  "@stryke/convert": "^0.6.58",
499
499
  "@stryke/env": "^0.20.83",
500
500
  "@stryke/fs": "^0.33.66",
@@ -508,24 +508,24 @@
508
508
  "c12": "^3.3.4",
509
509
  "chalk": "5.6.2",
510
510
  "compatx": "^0.2.0",
511
- "defu": "^6.1.6",
511
+ "defu": "^6.1.7",
512
512
  "diff-match-patch": "^1.0.5",
513
513
  "jiti": "^2.6.1",
514
514
  "magic-string": "^0.30.21",
515
- "prettier": "^3.8.1",
515
+ "prettier": "^3.8.2",
516
516
  "unplugin": "^3.0.0",
517
517
  "unplugin-combine": "^2.3.0"
518
518
  },
519
519
  "devDependencies": {
520
- "@storm-software/testing-tools": "^1.119.147",
520
+ "@storm-software/testing-tools": "^1.119.149",
521
521
  "@stryke/types": "^0.11.3",
522
522
  "@types/diff-match-patch": "^1.0.36",
523
- "@types/node": "^25.5.2",
523
+ "@types/node": "^25.6.0",
524
524
  "@types/semver": "^7.7.1",
525
525
  "prettier-plugin-organize-imports": "^4.3.0",
526
526
  "tsdown": "^0.21.7",
527
527
  "typescript": "^5.9.3"
528
528
  },
529
529
  "publishConfig": { "access": "public" },
530
- "gitHead": "5a6381d64cd7545c4109a9db959d4d0f29862208"
530
+ "gitHead": "59bead6fb9bcc2a63b45bcc54b0f4bc76213d511"
531
531
  }