@powerlines/core 0.12.1 → 0.12.2

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 +1 @@
1
- {"version":3,"file":"module-resolution.mjs","names":[],"sources":["../../../src/lib/unplugin/module-resolution.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 { isSetObject } from \"@stryke/type-checks/is-set-object\";\nimport { isSetString } from \"@stryke/type-checks/is-set-string\";\nimport defu from \"defu\";\nimport { LoadResult } from \"rollup\";\nimport type {\n UnpluginBuildContext,\n UnpluginContext,\n UnpluginOptions\n} from \"unplugin\";\nimport { UNSAFE_PluginContext } from \"../../types/_internal\";\nimport { PluginContext, ResolveResult } from \"../../types/context\";\nimport { ResolveOptions } from \"../../types/fs\";\n\nexport interface CreateUnpluginModuleResolutionFunctionsOptions {\n /**\n * An indicator of whether to prefix virtual module IDs with a specific string. This is useful for ensuring that virtual modules are only processed by the plugin and not by other plugins or the bundler itself.\n *\n * @remarks\n * - If set to `true`, virtual module IDs will be prefixed with the string `__powerlines-virtual:`.\n * - If set to `false`, no prefix will be added to virtual module IDs.\n *\n * @defaultValue true\n */\n prefix?: boolean;\n\n /**\n * Optional overrides for the module resolution configuration.\n *\n * @remarks\n * This allows you to customize the behavior of the module resolution hooks by providing specific configuration options.\n */\n overrides?: Partial<ResolveOptions>;\n}\n\nconst VIRTUAL_MODULE_PREFIX = \"__powerlines-virtual__:\";\nconst VIRTUAL_MODULE_PREFIX_REGEX = /^__powerlines-virtual__:/;\n\n/**\n * Creates the module resolution hook functions for a Powerlines unplugin plugin instance.\n *\n * @remarks\n * This includes the `resolveId` and `load` hooks.\n *\n * @see https://rollupjs.org/plugin-development/#resolveid\n * @see https://rollupjs.org/plugin-development/#load\n *\n * @param context - The plugin context.\n * @param options - Options for creating the module resolution functions.\n * @returns The module resolution hooks (`resolveId` and `load`).\n */\nexport function createUnpluginModuleResolutionFunctions<\n TContext extends PluginContext = PluginContext\n>(\n context: TContext,\n options: CreateUnpluginModuleResolutionFunctionsOptions = {}\n): Pick<UnpluginOptions, \"resolveId\" | \"load\"> {\n const ctx = context as unknown as UNSAFE_PluginContext;\n\n return {\n async resolveId(\n this: UnpluginBuildContext & UnpluginContext,\n id: string,\n importer?: string,\n opts: {\n isEntry: boolean;\n } = { isEntry: false }\n ): Promise<string | ResolveResult | null | undefined> {\n const normalizedId = id.replace(VIRTUAL_MODULE_PREFIX_REGEX, \"\");\n const normalizedImporter = importer\n ? importer.replace(VIRTUAL_MODULE_PREFIX_REGEX, \"\")\n : undefined;\n\n let result = await ctx.$$internal.callHook(\n \"resolveId\",\n {\n sequential: true,\n result: \"first\",\n order: \"pre\"\n },\n normalizedId,\n normalizedImporter,\n opts\n );\n if (isSetString(result)) {\n return result;\n } else if (isSetObject(result)) {\n return {\n ...result,\n id:\n result.virtual && options.prefix !== false\n ? `${VIRTUAL_MODULE_PREFIX}${result.id}`\n : result.id\n };\n }\n\n result = await ctx.$$internal.callHook(\n \"resolveId\",\n {\n sequential: true,\n result: \"first\",\n order: \"normal\"\n },\n normalizedId,\n normalizedImporter,\n opts\n );\n if (isSetString(result)) {\n return result;\n } else if (isSetObject(result)) {\n return {\n ...result,\n id:\n result.virtual && options.prefix !== false\n ? `${VIRTUAL_MODULE_PREFIX}${result.id}`\n : result.id\n };\n }\n\n result = await ctx.resolve(\n normalizedId,\n normalizedImporter,\n defu(options.overrides ?? {}, {\n isFile: true,\n ...opts\n })\n );\n if (isSetObject(result)) {\n return {\n ...result,\n id:\n result.virtual && options.prefix !== false\n ? `${VIRTUAL_MODULE_PREFIX}${result.id}`\n : result.id\n };\n }\n\n result = await ctx.$$internal.callHook(\n \"resolveId\",\n {\n sequential: true,\n result: \"first\",\n order: \"post\"\n },\n normalizedId,\n normalizedImporter,\n opts\n );\n if (isSetString(result)) {\n return result;\n } else if (isSetObject(result)) {\n return {\n ...result,\n id:\n result.virtual && options.prefix !== false\n ? `${VIRTUAL_MODULE_PREFIX}${result.id}`\n : result.id\n };\n }\n\n return null;\n },\n load: {\n filter:\n options.prefix !== false\n ? {\n id: {\n include: [VIRTUAL_MODULE_PREFIX_REGEX]\n }\n }\n : undefined,\n async handler(\n this: UnpluginBuildContext & UnpluginContext,\n id: string\n ): Promise<LoadResult | null | undefined> {\n const normalizedId = id.replace(VIRTUAL_MODULE_PREFIX_REGEX, \"\");\n\n let result = await ctx.$$internal.callHook(\n \"load\",\n {\n sequential: true,\n result: \"first\",\n order: \"pre\"\n },\n normalizedId\n );\n if (result) {\n return result;\n }\n\n result = await ctx.$$internal.callHook(\n \"load\",\n {\n sequential: true,\n result: \"first\",\n order: \"normal\"\n },\n normalizedId\n );\n if (result) {\n return result;\n }\n\n result = await ctx.load(normalizedId);\n if (result) {\n return result;\n }\n\n return ctx.$$internal.callHook(\n \"load\",\n {\n sequential: true,\n result: \"first\",\n order: \"post\"\n },\n normalizedId\n );\n }\n }\n };\n}\n"],"mappings":";;;;;AAoDA,MAAM,wBAAwB;AAC9B,MAAM,8BAA8B;;;;;;;;;;;;;;AAepC,SAAgB,wCAGd,SACA,UAA0D,EAAE,EACf;CAC7C,MAAM,MAAM;AAEZ,QAAO;EACL,MAAM,UAEJ,IACA,UACA,OAEI,EAAE,SAAS,OAAO,EAC8B;GACpD,MAAM,eAAe,GAAG,QAAQ,6BAA6B,GAAG;GAChE,MAAM,qBAAqB,WACvB,SAAS,QAAQ,6BAA6B,GAAG,GACjD;GAEJ,IAAI,SAAS,MAAM,IAAI,WAAW,SAChC,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EACD,aACD;AACD,QAAI,OACF,QAAO;AAGT,aAAS,MAAM,IAAI,WAAW,SAC5B,QACA;KACE,YAAY;KACZ,QAAQ;KACR,OAAO;KACR,EACD,aACD;AACD,QAAI,OACF,QAAO;AAGT,aAAS,MAAM,IAAI,KAAK,aAAa;AACrC,QAAI,OACF,QAAO;AAGT,WAAO,IAAI,WAAW,SACpB,QACA;KACE,YAAY;KACZ,QAAQ;KACR,OAAO;KACR,EACD,aACD;;GAEJ;EACF"}
1
+ {"version":3,"file":"module-resolution.mjs","names":[],"sources":["../../../src/lib/unplugin/module-resolution.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 { isSetObject } from \"@stryke/type-checks/is-set-object\";\nimport { isSetString } from \"@stryke/type-checks/is-set-string\";\nimport defu from \"defu\";\nimport { LoadResult } from \"rollup\";\nimport type {\n UnpluginBuildContext,\n UnpluginContext,\n UnpluginOptions\n} from \"unplugin\";\nimport { PluginContext, ResolveResult } from \"../../types/context\";\nimport { ResolveOptions } from \"../../types/fs\";\n\nexport interface CreateUnpluginModuleResolutionFunctionsOptions {\n /**\n * An indicator of whether to prefix virtual module IDs with a specific string. This is useful for ensuring that virtual modules are only processed by the plugin and not by other plugins or the bundler itself.\n *\n * @remarks\n * - If set to `true`, virtual module IDs will be prefixed with the string `__powerlines-virtual:`.\n * - If set to `false`, no prefix will be added to virtual module IDs.\n *\n * @defaultValue true\n */\n prefix?: boolean;\n\n /**\n * Optional overrides for the module resolution configuration.\n *\n * @remarks\n * This allows you to customize the behavior of the module resolution hooks by providing specific configuration options.\n */\n overrides?: Partial<ResolveOptions>;\n}\n\nconst VIRTUAL_MODULE_PREFIX = \"__powerlines-virtual__:\";\nconst VIRTUAL_MODULE_PREFIX_REGEX = /^__powerlines-virtual__:/;\n\n/**\n * Creates the module resolution hook functions for a Powerlines unplugin plugin instance.\n *\n * @remarks\n * This includes the `resolveId` and `load` hooks.\n *\n * @see https://rollupjs.org/plugin-development/#resolveid\n * @see https://rollupjs.org/plugin-development/#load\n *\n * @param context - The plugin context.\n * @param options - Options for creating the module resolution functions.\n * @returns The module resolution hooks (`resolveId` and `load`).\n */\nexport function createUnpluginModuleResolutionFunctions<\n TContext extends PluginContext = PluginContext\n>(\n context: TContext,\n options: CreateUnpluginModuleResolutionFunctionsOptions = {}\n): Pick<UnpluginOptions, \"resolveId\" | \"load\"> {\n const ctx = context as unknown as Unstable_PluginContext;\n\n return {\n async resolveId(\n this: UnpluginBuildContext & UnpluginContext,\n id: string,\n importer?: string,\n opts: {\n isEntry: boolean;\n } = { isEntry: false }\n ): Promise<string | ResolveResult | null | undefined> {\n const normalizedId = id.replace(VIRTUAL_MODULE_PREFIX_REGEX, \"\");\n const normalizedImporter = importer\n ? importer.replace(VIRTUAL_MODULE_PREFIX_REGEX, \"\")\n : undefined;\n\n let result = await ctx.$$internal.callHook(\n \"resolveId\",\n {\n sequential: true,\n result: \"first\",\n order: \"pre\"\n },\n normalizedId,\n normalizedImporter,\n opts\n );\n if (isSetString(result)) {\n return result;\n } else if (isSetObject(result)) {\n return {\n ...result,\n id:\n result.virtual && options.prefix !== false\n ? `${VIRTUAL_MODULE_PREFIX}${result.id}`\n : result.id\n };\n }\n\n result = await ctx.$$internal.callHook(\n \"resolveId\",\n {\n sequential: true,\n result: \"first\",\n order: \"normal\"\n },\n normalizedId,\n normalizedImporter,\n opts\n );\n if (isSetString(result)) {\n return result;\n } else if (isSetObject(result)) {\n return {\n ...result,\n id:\n result.virtual && options.prefix !== false\n ? `${VIRTUAL_MODULE_PREFIX}${result.id}`\n : result.id\n };\n }\n\n result = await ctx.resolve(\n normalizedId,\n normalizedImporter,\n defu(options.overrides ?? {}, {\n isFile: true,\n ...opts\n })\n );\n if (isSetObject(result)) {\n return {\n ...result,\n id:\n result.virtual && options.prefix !== false\n ? `${VIRTUAL_MODULE_PREFIX}${result.id}`\n : result.id\n };\n }\n\n result = await ctx.$$internal.callHook(\n \"resolveId\",\n {\n sequential: true,\n result: \"first\",\n order: \"post\"\n },\n normalizedId,\n normalizedImporter,\n opts\n );\n if (isSetString(result)) {\n return result;\n } else if (isSetObject(result)) {\n return {\n ...result,\n id:\n result.virtual && options.prefix !== false\n ? `${VIRTUAL_MODULE_PREFIX}${result.id}`\n : result.id\n };\n }\n\n return null;\n },\n load: {\n filter:\n options.prefix !== false\n ? {\n id: {\n include: [VIRTUAL_MODULE_PREFIX_REGEX]\n }\n }\n : undefined,\n async handler(\n this: UnpluginBuildContext & UnpluginContext,\n id: string\n ): Promise<LoadResult | null | undefined> {\n const normalizedId = id.replace(VIRTUAL_MODULE_PREFIX_REGEX, \"\");\n\n let result = await ctx.$$internal.callHook(\n \"load\",\n {\n sequential: true,\n result: \"first\",\n order: \"pre\"\n },\n normalizedId\n );\n if (result) {\n return result;\n }\n\n result = await ctx.$$internal.callHook(\n \"load\",\n {\n sequential: true,\n result: \"first\",\n order: \"normal\"\n },\n normalizedId\n );\n if (result) {\n return result;\n }\n\n result = await ctx.load(normalizedId);\n if (result) {\n return result;\n }\n\n return ctx.$$internal.callHook(\n \"load\",\n {\n sequential: true,\n result: \"first\",\n order: \"post\"\n },\n normalizedId\n );\n }\n }\n };\n}\n"],"mappings":";;;;;AAoDA,MAAM,wBAAwB;AAC9B,MAAM,8BAA8B;;;;;;;;;;;;;;AAepC,SAAgB,wCAGd,SACA,UAA0D,EAAE,EACf;CAC7C,MAAM,MAAM;AAEZ,QAAO;EACL,MAAM,UAEJ,IACA,UAC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,4BAA4B,EACvC,EACF,GACD;GACN,MAAM,QAEJ,IACwC;IACxC,MAAM,eAAe,GAAG,QAAQ,6BAA6B,GAAG;IAEhE,IAAI,SAAS,MAAM,IAAI,WAAW,SAChC,QACA;KACE,YAAY;KACZ,QAAQ;KACR,OAAO;KACR,EACD,aACD;AACD,QAAI,OACF,QAAO;AAGT,aAAS,MAAM,IAAI,WAAW,SAC5B,QACA;KACE,YAAY;KACZ,QAAQ;KACR,OAAO;KACR,EACD,aACD;AACD,QAAI,OACF,QAAO;AAGT,aAAS,MAAM,IAAI,KAAK,aAAa;AACrC,QAAI,OACF,QAAO;AAGT,WAAO,IAAI,WAAW,SACpB,QACA;KACE,YAAY;KACZ,QAAQ;KACR,OAAO;KACR,EACD,aACD;;GAEJ;EACF"}
@@ -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 { 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 { UNSAFE_PluginContext } from \"../../types/_internal\";\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 UNSAFE_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 UNSAFE_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,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ACJ,mBAAmB,MACpB;IACF;WACM,OAAO;AACd,OAAI,cAAc,OAAQ,OAAiB,QAAQ;AAEnD,SAAM"}
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,IAAI,WAAW;IACpB;IACA;IACD;WACM,OAAO;AACd,OAAI,cAAc,OAAQ,OAAiB,QAAQ;AAEnD,SAAM;;;;;;;;;;AAaZ,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,OAAO,sCAAsC;AAE/D,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,OAAO,uCAAuC;AAEhE,WAAO,IAAI,WAAW,SAAS,YAAY,EACzC,YAAY,MACb,CAAC;;GAGJ,eAAe,cAA6B;AAC1C,QAAI,cAAc,OAAO,0CAA0C;AAEnE,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"}
@@ -9,7 +9,7 @@ import { PluginConfig, ResolvedConfig } from "./config.cjs";
9
9
  *
10
10
  * @internal
11
11
  */
12
- interface UNSAFE_ContextInternal<TResolvedConfig extends ResolvedConfig = ResolvedConfig> {
12
+ interface Unstable_ContextInternal<TResolvedConfig extends ResolvedConfig = ResolvedConfig> {
13
13
  /**
14
14
  * The API instance for interacting with Powerlines
15
15
  *
@@ -30,31 +30,31 @@ interface UNSAFE_ContextInternal<TResolvedConfig extends ResolvedConfig = Resolv
30
30
  *
31
31
  * @internal
32
32
  */
33
- interface UNSAFE_Context<TResolvedConfig extends ResolvedConfig = ResolvedConfig> extends Context<TResolvedConfig> {
34
- $$internal: UNSAFE_ContextInternal<TResolvedConfig>;
33
+ interface Unstable_Context<TResolvedConfig extends ResolvedConfig = ResolvedConfig> extends Context<TResolvedConfig> {
34
+ $$internal: Unstable_ContextInternal<TResolvedConfig>;
35
35
  }
36
36
  /**
37
37
  * An internal representation of the API context, used for managing hooks and environment data.
38
38
  *
39
39
  * @internal
40
40
  */
41
- interface UNSAFE_APIContext<TResolvedConfig extends ResolvedConfig = ResolvedConfig> extends APIContext<TResolvedConfig> {
42
- $$internal: UNSAFE_ContextInternal<TResolvedConfig>;
41
+ interface Unstable_APIContext<TResolvedConfig extends ResolvedConfig = ResolvedConfig> extends APIContext<TResolvedConfig> {
42
+ $$internal: Unstable_ContextInternal<TResolvedConfig>;
43
43
  }
44
44
  /**
45
45
  * An internal representation of the environment context, used for managing hooks and environment data.
46
46
  *
47
47
  * @internal
48
48
  */
49
- interface UNSAFE_EnvironmentContext<TResolvedConfig extends ResolvedConfig = ResolvedConfig> extends EnvironmentContext<TResolvedConfig> {
50
- $$internal: UNSAFE_ContextInternal<TResolvedConfig>;
49
+ interface Unstable_EnvironmentContext<TResolvedConfig extends ResolvedConfig = ResolvedConfig> extends EnvironmentContext<TResolvedConfig> {
50
+ $$internal: Unstable_ContextInternal<TResolvedConfig>;
51
51
  }
52
52
  /**
53
53
  * Internal fields and methods for the internal plugin context
54
54
  *
55
55
  * @internal
56
56
  */
57
- interface UNSAFE_PluginContextInternal<TResolvedConfig extends ResolvedConfig = ResolvedConfig> extends UNSAFE_ContextInternal<TResolvedConfig> {
57
+ interface Unstable_PluginContextInternal<TResolvedConfig extends ResolvedConfig = ResolvedConfig> extends Unstable_ContextInternal<TResolvedConfig> {
58
58
  /**
59
59
  * The API instance for interacting with Powerlines
60
60
  *
@@ -66,7 +66,7 @@ interface UNSAFE_PluginContextInternal<TResolvedConfig extends ResolvedConfig =
66
66
  *
67
67
  * @internal
68
68
  */
69
- environment: UNSAFE_EnvironmentContext<TResolvedConfig>;
69
+ environment: Unstable_EnvironmentContext<TResolvedConfig>;
70
70
  /**
71
71
  * Call a hook within the Powerlines system
72
72
  *
@@ -92,15 +92,15 @@ interface UNSAFE_PluginContextInternal<TResolvedConfig extends ResolvedConfig =
92
92
  *
93
93
  * @internal
94
94
  */
95
- interface UNSAFE_PluginContext<TResolvedConfig extends ResolvedConfig = ResolvedConfig> extends PluginContext<TResolvedConfig> {
96
- $$internal: UNSAFE_PluginContextInternal<TResolvedConfig>;
95
+ interface Unstable_PluginContext<TResolvedConfig extends ResolvedConfig = ResolvedConfig> extends PluginContext<TResolvedConfig> {
96
+ $$internal: Unstable_PluginContextInternal<TResolvedConfig>;
97
97
  }
98
- declare type __ΩUNSAFE_ContextInternal = any[];
99
- declare type __ΩUNSAFE_Context = any[];
100
- declare type __ΩUNSAFE_APIContext = any[];
101
- declare type __ΩUNSAFE_EnvironmentContext = any[];
102
- declare type __ΩUNSAFE_PluginContextInternal = any[];
103
- declare type __ΩUNSAFE_PluginContext = any[];
98
+ declare type __ΩUnstable_ContextInternal = any[];
99
+ declare type __ΩUnstable_Context = any[];
100
+ declare type __ΩUnstable_APIContext = any[];
101
+ declare type __ΩUnstable_EnvironmentContext = any[];
102
+ declare type __ΩUnstable_PluginContextInternal = any[];
103
+ declare type __ΩUnstable_PluginContext = any[];
104
104
  //#endregion
105
- export { UNSAFE_APIContext, UNSAFE_Context, UNSAFE_ContextInternal, UNSAFE_EnvironmentContext, UNSAFE_PluginContext, UNSAFE_PluginContextInternal, __ΩUNSAFE_APIContext, __ΩUNSAFE_Context, __ΩUNSAFE_ContextInternal, __ΩUNSAFE_EnvironmentContext, __ΩUNSAFE_PluginContext, __ΩUNSAFE_PluginContextInternal };
105
+ export { Unstable_APIContext, Unstable_Context, Unstable_ContextInternal, Unstable_EnvironmentContext, Unstable_PluginContext, Unstable_PluginContextInternal, __ΩUnstable_APIContext, __ΩUnstable_Context, __ΩUnstable_ContextInternal, __ΩUnstable_EnvironmentContext, __ΩUnstable_PluginContext, __ΩUnstable_PluginContextInternal };
106
106
  //# sourceMappingURL=_internal.d.cts.map
@@ -1 +1 @@
1
- {"version":3,"file":"_internal.d.cts","names":[],"sources":["../../src/types/_internal.ts"],"mappings":";;;;;;;;AAuCA;;;UAAiB,sBAAA,yBACS,cAAA,GAAiB,cAAA;EAAA;;;;;EAOzC,GAAA,EAAK,GAAA,CAAI,eAAA;EAWJ;;;;;;;EAFL,SAAA,GACE,MAAA,EAAQ,YAAA,CAAa,aAAA,CAAc,eAAA,OAChC,OAAA;AAAA;;;;;;UAQU,cAAA,yBACS,cAAA,GAAiB,cAAA,UACjC,OAAA,CAAQ,eAAA;EAChB,UAAA,EAAY,sBAAA,CAAuB,eAAA;AAAA;AAHrC;;;;;AAAA,UAWiB,iBAAA,yBACS,cAAA,GAAiB,cAAA,UACjC,UAAA,CAAW,eAAA;EACnB,UAAA,EAAY,sBAAA,CAAuB,eAAA;AAAA;;;;;;UAQpB,yBAAA,yBACS,cAAA,GAAiB,cAAA,UACjC,kBAAA,CAAmB,eAAA;EAC3B,UAAA,EAAY,sBAAA,CAAuB,eAAA;AAAA;;;;;;UAQpB,4BAAA,yBACS,cAAA,GAAiB,cAAA,UACjC,sBAAA,CAAuB,eAAA;EAxBC;;;;;EA8BhC,GAAA,EAAK,GAAA,CAAI,eAAA;EA3BG;;;;;EAkCZ,WAAA,EAAa,yBAAA,CAA0B,eAAA;EApCE;;;;;;;;AAU3C;;EAsCE,QAAA,wBACE,IAAA,EAAM,IAAA,EACN,OAAA,EAAS,eAAA;IACP,WAAA,YAAuB,kBAAA,CAAmB,eAAA;EAAA,MAEzC,IAAA,EAAM,mBAAA,CAAoB,aAAA,CAAc,eAAA,GAAkB,IAAA,MAC1D,OAAA,CACH,mBAAA,CAAoB,aAAA,CAAc,eAAA,GAAkB,IAAA;EA3C3B;;;;;EAmD3B,IAAA,EAAM,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;;;;UAQS,sBAAA,yBACS,cAAA,GAAiB,cAAA,UACjC,aAAA,CAAc,eAAA;EACtB,UAAA,EAAY,8BAAA,CAA+B,eAAA;AAAA;AAAA"}
@@ -9,7 +9,7 @@ import { PluginConfig, ResolvedConfig } from "./config.mjs";
9
9
  *
10
10
  * @internal
11
11
  */
12
- interface UNSAFE_ContextInternal<TResolvedConfig extends ResolvedConfig = ResolvedConfig> {
12
+ interface Unstable_ContextInternal<TResolvedConfig extends ResolvedConfig = ResolvedConfig> {
13
13
  /**
14
14
  * The API instance for interacting with Powerlines
15
15
  *
@@ -30,31 +30,31 @@ interface UNSAFE_ContextInternal<TResolvedConfig extends ResolvedConfig = Resolv
30
30
  *
31
31
  * @internal
32
32
  */
33
- interface UNSAFE_Context<TResolvedConfig extends ResolvedConfig = ResolvedConfig> extends Context<TResolvedConfig> {
34
- $$internal: UNSAFE_ContextInternal<TResolvedConfig>;
33
+ interface Unstable_Context<TResolvedConfig extends ResolvedConfig = ResolvedConfig> extends Context<TResolvedConfig> {
34
+ $$internal: Unstable_ContextInternal<TResolvedConfig>;
35
35
  }
36
36
  /**
37
37
  * An internal representation of the API context, used for managing hooks and environment data.
38
38
  *
39
39
  * @internal
40
40
  */
41
- interface UNSAFE_APIContext<TResolvedConfig extends ResolvedConfig = ResolvedConfig> extends APIContext<TResolvedConfig> {
42
- $$internal: UNSAFE_ContextInternal<TResolvedConfig>;
41
+ interface Unstable_APIContext<TResolvedConfig extends ResolvedConfig = ResolvedConfig> extends APIContext<TResolvedConfig> {
42
+ $$internal: Unstable_ContextInternal<TResolvedConfig>;
43
43
  }
44
44
  /**
45
45
  * An internal representation of the environment context, used for managing hooks and environment data.
46
46
  *
47
47
  * @internal
48
48
  */
49
- interface UNSAFE_EnvironmentContext<TResolvedConfig extends ResolvedConfig = ResolvedConfig> extends EnvironmentContext<TResolvedConfig> {
50
- $$internal: UNSAFE_ContextInternal<TResolvedConfig>;
49
+ interface Unstable_EnvironmentContext<TResolvedConfig extends ResolvedConfig = ResolvedConfig> extends EnvironmentContext<TResolvedConfig> {
50
+ $$internal: Unstable_ContextInternal<TResolvedConfig>;
51
51
  }
52
52
  /**
53
53
  * Internal fields and methods for the internal plugin context
54
54
  *
55
55
  * @internal
56
56
  */
57
- interface UNSAFE_PluginContextInternal<TResolvedConfig extends ResolvedConfig = ResolvedConfig> extends UNSAFE_ContextInternal<TResolvedConfig> {
57
+ interface Unstable_PluginContextInternal<TResolvedConfig extends ResolvedConfig = ResolvedConfig> extends Unstable_ContextInternal<TResolvedConfig> {
58
58
  /**
59
59
  * The API instance for interacting with Powerlines
60
60
  *
@@ -66,7 +66,7 @@ interface UNSAFE_PluginContextInternal<TResolvedConfig extends ResolvedConfig =
66
66
  *
67
67
  * @internal
68
68
  */
69
- environment: UNSAFE_EnvironmentContext<TResolvedConfig>;
69
+ environment: Unstable_EnvironmentContext<TResolvedConfig>;
70
70
  /**
71
71
  * Call a hook within the Powerlines system
72
72
  *
@@ -92,15 +92,15 @@ interface UNSAFE_PluginContextInternal<TResolvedConfig extends ResolvedConfig =
92
92
  *
93
93
  * @internal
94
94
  */
95
- interface UNSAFE_PluginContext<TResolvedConfig extends ResolvedConfig = ResolvedConfig> extends PluginContext<TResolvedConfig> {
96
- $$internal: UNSAFE_PluginContextInternal<TResolvedConfig>;
95
+ interface Unstable_PluginContext<TResolvedConfig extends ResolvedConfig = ResolvedConfig> extends PluginContext<TResolvedConfig> {
96
+ $$internal: Unstable_PluginContextInternal<TResolvedConfig>;
97
97
  }
98
- declare type __ΩUNSAFE_ContextInternal = any[];
99
- declare type __ΩUNSAFE_Context = any[];
100
- declare type __ΩUNSAFE_APIContext = any[];
101
- declare type __ΩUNSAFE_EnvironmentContext = any[];
102
- declare type __ΩUNSAFE_PluginContextInternal = any[];
103
- declare type __ΩUNSAFE_PluginContext = any[];
98
+ declare type __ΩUnstable_ContextInternal = any[];
99
+ declare type __ΩUnstable_Context = any[];
100
+ declare type __ΩUnstable_APIContext = any[];
101
+ declare type __ΩUnstable_EnvironmentContext = any[];
102
+ declare type __ΩUnstable_PluginContextInternal = any[];
103
+ declare type __ΩUnstable_PluginContext = any[];
104
104
  //#endregion
105
- export { UNSAFE_APIContext, UNSAFE_Context, UNSAFE_ContextInternal, UNSAFE_EnvironmentContext, UNSAFE_PluginContext, UNSAFE_PluginContextInternal, __ΩUNSAFE_APIContext, __ΩUNSAFE_Context, __ΩUNSAFE_ContextInternal, __ΩUNSAFE_EnvironmentContext, __ΩUNSAFE_PluginContext, __ΩUNSAFE_PluginContextInternal };
105
+ export { Unstable_APIContext, Unstable_Context, Unstable_ContextInternal, Unstable_EnvironmentContext, Unstable_PluginContext, Unstable_PluginContextInternal, __ΩUnstable_APIContext, __ΩUnstable_Context, __ΩUnstable_ContextInternal, __ΩUnstable_EnvironmentContext, __ΩUnstable_PluginContext, __ΩUnstable_PluginContextInternal };
106
106
  //# sourceMappingURL=_internal.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"_internal.d.mts","names":[],"sources":["../../src/types/_internal.ts"],"mappings":";;;;;;;;AAuCA;;;UAAiB,sBAAA,yBACS,cAAA,GAAiB,cAAA;EAAA;;;;;EAOzC,GAAA,EAAK,GAAA,CAAI,eAAA;EAWJ;;;;;;;EAFL,SAAA,GACE,MAAA,EAAQ,YAAA,CAAa,aAAA,CAAc,eAAA,OAChC,OAAA;AAAA;;;;;;UAQU,cAAA,yBACS,cAAA,GAAiB,cAAA,UACjC,OAAA,CAAQ,eAAA;EAChB,UAAA,EAAY,sBAAA,CAAuB,eAAA;AAAA;AAHrC;;;;;AAAA,UAWiB,iBAAA,yBACS,cAAA,GAAiB,cAAA,UACjC,UAAA,CAAW,eAAA;EACnB,UAAA,EAAY,sBAAA,CAAuB,eAAA;AAAA;;;;;;UAQpB,yBAAA,yBACS,cAAA,GAAiB,cAAA,UACjC,kBAAA,CAAmB,eAAA;EAC3B,UAAA,EAAY,sBAAA,CAAuB,eAAA;AAAA;;;;;;UAQpB,4BAAA,yBAC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B,cAAA,UACjC,wBAAA,CAAyB,eAAA;EAxBC;;;;;EA8BlC,GAAA,EAAK,GAAA,CAAI,eAAA;EA3BG;;;;;EAkCZ,WAAA,EAAa,2BAAA,CAA4B,eAAA;EApCA;;;;;;;;AAU3C;;EAsCE,QAAA,wBACE,IAAA,EAAM,IAAA,EACN,OAAA,EAAS,eAAA;IACP,WAAA,YAAuB,kBAAA,CAAmB,eAAA;EAAA,MAEzC,IAAA,EAAM,mBAAA,CAAoB,aAAA,CAAc,eAAA,GAAkB,IAAA,MAC1D,OAAA,CACH,mBAAA,CAAoB,aAAA,CAAc,eAAA,GAAkB,IAAA;EA3C3B;;;;;EAmD3B,IAAA,EAAM,MAAA;AAAA;;;;;;UAQS,sBAAA,yBACS,cAAA,GAAiB,cAAA,UACjC,aAAA,CAAc,eAAA;EACtB,UAAA,EAAY,8BAAA,CAA+B,eAAA;AAAA;AAAA"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@powerlines/core",
3
- "version": "0.12.1",
3
+ "version": "0.12.2",
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.11",
497
- "@storm-software/config-tools": "^1.189.57",
496
+ "@storm-software/config": "^1.137.14",
497
+ "@storm-software/config-tools": "^1.189.60",
498
498
  "@stryke/convert": "^0.6.57",
499
499
  "@stryke/env": "^0.20.81",
500
500
  "@stryke/fs": "^0.33.64",
@@ -517,7 +517,7 @@
517
517
  "unplugin-combine": "^2.3.0"
518
518
  },
519
519
  "devDependencies": {
520
- "@storm-software/testing-tools": "^1.119.132",
520
+ "@storm-software/testing-tools": "^1.119.135",
521
521
  "@stryke/types": "^0.11.2",
522
522
  "@types/diff-match-patch": "^1.0.36",
523
523
  "@types/node": "^25.5.0",
@@ -527,5 +527,5 @@
527
527
  "typescript": "^5.9.3"
528
528
  },
529
529
  "publishConfig": { "access": "public" },
530
- "gitHead": "e4cf83423cc9df85f747265b04d051bdfd4d1156"
530
+ "gitHead": "4042ae8096ab1aae106c743a39ee41047307dce3"
531
531
  }