@powerlines/core 0.15.1 → 0.15.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.
- package/dist/context/environment-context.cjs +3 -3
- package/dist/context/environment-context.mjs +3 -3
- package/dist/context/environment-context.mjs.map +1 -1
- package/dist/lib/entry.d.cts +5 -5
- package/dist/lib/entry.d.cts.map +1 -1
- package/dist/lib/entry.d.mts +5 -5
- package/dist/lib/entry.d.mts.map +1 -1
- package/dist/lib/entry.mjs.map +1 -1
- package/dist/lib/unplugin/module-resolution.d.cts +2 -2
- package/dist/lib/unplugin/module-resolution.d.cts.map +1 -1
- package/dist/lib/unplugin/module-resolution.d.mts +2 -2
- package/dist/lib/unplugin/module-resolution.d.mts.map +1 -1
- package/dist/lib/unplugin/module-resolution.mjs.map +1 -1
- package/dist/lib/unplugin/plugin.d.cts +2 -2
- package/dist/lib/unplugin/plugin.d.cts.map +1 -1
- package/dist/lib/unplugin/plugin.d.mts +2 -2
- package/dist/lib/unplugin/plugin.d.mts.map +1 -1
- package/dist/lib/unplugin/plugin.mjs.map +1 -1
- package/dist/plugin-utils/build-helpers.d.cts +2 -2
- package/dist/plugin-utils/build-helpers.d.cts.map +1 -1
- package/dist/plugin-utils/build-helpers.d.mts +2 -2
- package/dist/plugin-utils/build-helpers.d.mts.map +1 -1
- package/dist/plugin-utils/build-helpers.mjs.map +1 -1
- package/dist/types/context.d.cts +2 -16
- package/dist/types/context.d.cts.map +1 -1
- package/dist/types/context.d.mts +2 -16
- package/dist/types/context.d.mts.map +1 -1
- package/dist/types/unplugin.d.cts +2 -2
- package/dist/types/unplugin.d.cts.map +1 -1
- package/dist/types/unplugin.d.mts +2 -2
- package/dist/types/unplugin.d.mts.map +1 -1
- package/package.json +18 -18
|
@@ -130,12 +130,12 @@ var PowerlinesEnvironmentContext = class PowerlinesEnvironmentContext extends re
|
|
|
130
130
|
}
|
|
131
131
|
const id = (0, _stryke_unique_id_uuid.uuid)();
|
|
132
132
|
const context = require_context_plugin_context.createPluginContext(id, resolvedPlugin, this);
|
|
133
|
-
resolvedPlugin
|
|
133
|
+
resolvedPlugin["~internal"] = {
|
|
134
134
|
id,
|
|
135
135
|
context
|
|
136
136
|
};
|
|
137
137
|
this.plugins.push(resolvedPlugin);
|
|
138
|
-
this.#hooks = Object.entries(Object.keys(resolvedPlugin).filter((key) => key !== "
|
|
138
|
+
this.#hooks = Object.entries(Object.keys(resolvedPlugin).filter((key) => key !== "~internal" && !require_constants_plugin.PLUGIN_NON_HOOK_FIELDS.includes(key)).reduce((ret, key) => require_lib_hooks.extractHooks(context, ret, resolvedPlugin, key), this.hooks)).reduce((ret, [key, value]) => {
|
|
139
139
|
if ((0, _stryke_type_checks_is_set_object.isSetObject)(value)) Object.entries(value).forEach(([type, list]) => {
|
|
140
140
|
ret[key] ??= {};
|
|
141
141
|
ret[key][type] = require_plugin_utils_helpers.dedupeHooklist(list);
|
|
@@ -157,7 +157,7 @@ var PowerlinesEnvironmentContext = class PowerlinesEnvironmentContext extends re
|
|
|
157
157
|
return {
|
|
158
158
|
handler: hook.handler,
|
|
159
159
|
plugin: hook.plugin,
|
|
160
|
-
context: plugin
|
|
160
|
+
context: plugin["~internal"].context
|
|
161
161
|
};
|
|
162
162
|
});
|
|
163
163
|
if (options?.order === "pre") {
|
|
@@ -128,12 +128,12 @@ var PowerlinesEnvironmentContext = class PowerlinesEnvironmentContext extends Po
|
|
|
128
128
|
}
|
|
129
129
|
const id = uuid();
|
|
130
130
|
const context = createPluginContext(id, resolvedPlugin, this);
|
|
131
|
-
resolvedPlugin
|
|
131
|
+
resolvedPlugin["~internal"] = {
|
|
132
132
|
id,
|
|
133
133
|
context
|
|
134
134
|
};
|
|
135
135
|
this.plugins.push(resolvedPlugin);
|
|
136
|
-
this.#hooks = Object.entries(Object.keys(resolvedPlugin).filter((key) => key !== "
|
|
136
|
+
this.#hooks = Object.entries(Object.keys(resolvedPlugin).filter((key) => key !== "~internal" && !PLUGIN_NON_HOOK_FIELDS.includes(key)).reduce((ret, key) => extractHooks(context, ret, resolvedPlugin, key), this.hooks)).reduce((ret, [key, value]) => {
|
|
137
137
|
if (isSetObject(value)) Object.entries(value).forEach(([type, list]) => {
|
|
138
138
|
ret[key] ??= {};
|
|
139
139
|
ret[key][type] = dedupeHooklist(list);
|
|
@@ -155,7 +155,7 @@ var PowerlinesEnvironmentContext = class PowerlinesEnvironmentContext extends Po
|
|
|
155
155
|
return {
|
|
156
156
|
handler: hook.handler,
|
|
157
157
|
plugin: hook.plugin,
|
|
158
|
-
context: plugin
|
|
158
|
+
context: plugin["~internal"].context
|
|
159
159
|
};
|
|
160
160
|
});
|
|
161
161
|
if (options?.order === "pre") {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"environment-context.mjs","names":["#hooks","#execution"],"sources":["../../src/context/environment-context.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 { omit } from \"@stryke/helpers/omit\";\nimport { isFunction } from \"@stryke/type-checks/is-function\";\nimport { isObject } from \"@stryke/type-checks/is-object\";\nimport { isSetObject } from \"@stryke/type-checks/is-set-object\";\nimport { ArrayValues } from \"@stryke/types/array\";\nimport { uuid } from \"@stryke/unique-id/uuid\";\nimport { DEFAULT_ENVIRONMENT, PLUGIN_NON_HOOK_FIELDS } from \"../constants\";\nimport { extractHooks } from \"../lib/hooks\";\nimport { resolvePlugins } from \"../lib/plugins\";\nimport {\n dedupeHooklist,\n formatConfig,\n isPlugin,\n isPluginConfig,\n isPluginHookField,\n mergeConfig\n} from \"../plugin-utils\";\nimport type {\n EnvironmentContext,\n EnvironmentPlugin,\n EnvironmentResolvedConfig,\n ExecutionContext,\n ExecutionOptions,\n HooksList,\n HooksListItem,\n InferOverridableConfig,\n Logger,\n LoggerOptions,\n PluginConfig,\n PluginContext,\n ResolvedConfig,\n SelectHookResult,\n SelectHooksOptions\n} from \"../types\";\nimport { PowerlinesContext } from \"./context\";\nimport { createPluginContext } from \"./plugin-context\";\n\nexport class PowerlinesEnvironmentContext<\n TResolvedConfig extends ResolvedConfig = ResolvedConfig,\n TSystemContext = unknown\n>\n extends PowerlinesContext<\n EnvironmentResolvedConfig<TResolvedConfig>,\n TSystemContext\n >\n implements EnvironmentContext<TResolvedConfig, TSystemContext>\n{\n /**\n * The hooks registered by plugins in this environment\n */\n #hooks: Record<\n string,\n HooksList<PluginContext<TResolvedConfig, TSystemContext>>\n > = {};\n\n /**\n * The execution context associated with this environment, which provides access to the project configuration, environment, and utility functions for performing the build. The execution context is used to manage the state and behavior of the build process across multiple environments, allowing for hooks to be called at different stages of the build and for environment-specific configurations to be applied.\n */\n #execution: ExecutionContext<TResolvedConfig, TSystemContext>;\n\n /**\n * Create a new context from the config.\n *\n * @param execution - The execution context for the build process, which provides access to the project configuration, environment, and utility functions for performing the build. The context is used to manage the state and behavior of the build process, allowing for hooks to be called at different stages of the build and for environment-specific configurations to be applied.\n * @param options - The resolved execution options.\n * @param config - The user configuration options.\n * @param overriddenConfig - The configuration options that should override all other configuration sources, such as CLI flags or environment variables. This is used to ensure that certain configuration values take precedence over any other settings defined in the user configuration or environment configuration, allowing for dynamic overrides based on the execution context.\n * @returns A promise that resolves to an instance of the PowerlinesEnvironmentContext class, initialized with the provided configuration and environment data.\n */\n public static async from<\n TResolvedConfig extends ResolvedConfig = ResolvedConfig,\n TSystemContext = unknown\n >(\n execution: ExecutionContext<TResolvedConfig, TSystemContext>,\n options: ExecutionOptions,\n config: TResolvedConfig,\n overriddenConfig: InferOverridableConfig<\n EnvironmentResolvedConfig<TResolvedConfig>\n >\n ): Promise<PowerlinesEnvironmentContext<TResolvedConfig, TSystemContext>> {\n const context = new PowerlinesEnvironmentContext<\n TResolvedConfig,\n TSystemContext\n >(execution, options, config, overriddenConfig);\n await context.init();\n\n return context;\n }\n\n /**\n * The configuration options provided by plugins added by the user (and other plugins)\n */\n protected override environmentConfig: EnvironmentResolvedConfig<TResolvedConfig>[\"environment\"] =\n {} as EnvironmentResolvedConfig<TResolvedConfig>[\"environment\"];\n\n /**\n * The list of plugins applied to this environment\n */\n public plugins: EnvironmentPlugin<TResolvedConfig, TSystemContext>[] = [];\n\n /**\n * The unique identifier of the environment associated with this context, which can be used for logging and other purposes to distinguish between different environments in the same process.\n */\n public get id(): string {\n return this.config.environment.id;\n }\n\n /**\n * The hooks registered by plugins in this environment\n */\n public get hooks(): Record<\n string,\n HooksList<PluginContext<TResolvedConfig, TSystemContext>>\n > {\n return this.#hooks;\n }\n\n /**\n * The execution context associated with this environment, which provides access to the project configuration, environment, and utility functions for performing the build. The execution context is used to manage the state and behavior of the build process across multiple environments, allowing for hooks to be called at different stages of the build and for environment-specific configurations to be applied.\n *\n * @danger\n * This field is for internal use only and should not be accessed or modified directly. It is unstable and can be changed at anytime.\n *\n * @internal\n */\n public get unstable_execution(): ExecutionContext<\n TResolvedConfig,\n TSystemContext\n > {\n return this.#execution;\n }\n\n /**\n * A setter function to populate the environment config values provided during execution of the command, such as CLI flags or other parameters that may be relevant to the command being executed. This function can be used to update the context with the environment configuration values, which may be used during the configuration resolution process to ensure that the final configuration reflects both the user configuration and any environment configuration provided during execution.\n *\n * @param config - The environment configuration values to set.\n * @returns A promise that resolves when the environment configuration values have been set.\n */\n public async setEnvironmentConfig(\n config: EnvironmentResolvedConfig<TResolvedConfig>[\"environment\"]\n ): Promise<void> {\n this.logger.debug({\n meta: { category: \"config\" },\n message: `Updating environment configuration object: \\n${formatConfig(config)}`\n });\n\n this.environmentConfig = config;\n await this.resolveConfig();\n }\n\n /**\n * Create a new logger instance\n *\n * @param options - The configuration options to use for the logger instance, which can be used to customize the appearance and behavior of the log messages generated by the logger. This is typically the name of the plugin or module that is creating the logger instance.\n * @returns A logger client instance that can be used to generate log messages with consistent formatting and metadata.\n */\n public override createLogger(options: LoggerOptions): Logger {\n return super.createLogger({\n ...options,\n environment: this.environmentConfig?.name || this.config.environment?.name\n });\n }\n\n /**\n * Extend the base logger with additional configuration options\n *\n * @param options - The configuration options to extend the base logger with, which can be used to add additional metadata or customize the appearance of log messages generated by the logger. This is typically the name of the plugin or module that is creating the logger instance, as well as any additional metadata such as the plugin category or environment.\n * @returns A new logger client instance that extends the base logger with the provided configuration options.\n */\n public override extendLogger(options: LoggerOptions): Logger {\n return super.extendLogger({\n ...options,\n environment: this.environmentConfig?.name || this.config.environment?.name\n });\n }\n\n /**\n * A function used internally to add a plugin to the context and update the configuration options\n *\n * @danger\n * This field is for internal use only and should not be accessed or modified directly. It is unstable and can be changed at anytime.\n *\n * @internal\n */\n public async unstable_addPlugin(\n plugin: PluginConfig<PluginContext<TResolvedConfig, TSystemContext>>\n ): Promise<void> {\n const plugins = await resolvePlugins<TResolvedConfig, TSystemContext>(\n this,\n plugin\n );\n for (const plugin of plugins) {\n let resolvedPlugin = plugin as EnvironmentPlugin<\n TResolvedConfig,\n TSystemContext\n >;\n if (isFunction(plugin.applyToEnvironment)) {\n const result = (await Promise.resolve(\n plugin.applyToEnvironment(this.config.environment) as Promise<any>\n )) as\n | boolean\n | PluginConfig<PluginContext<TResolvedConfig, TSystemContext>>;\n\n if (!result || (isObject(result) && Object.keys(result).length === 0)) {\n return;\n }\n\n if (\n isPluginConfig<PluginContext<TResolvedConfig, TSystemContext>>(result)\n ) {\n return this.unstable_addPlugin(result);\n }\n\n resolvedPlugin = (\n isPlugin<PluginContext<TResolvedConfig, TSystemContext>>(result)\n ? result\n : plugin\n ) as EnvironmentPlugin<TResolvedConfig, TSystemContext>;\n }\n\n const id = uuid();\n const context = createPluginContext<TResolvedConfig, TSystemContext>(\n id,\n resolvedPlugin,\n this\n );\n\n resolvedPlugin.$$internal = {\n id,\n context\n };\n\n this.plugins.push(resolvedPlugin);\n\n this.#hooks = Object.entries(\n Object.keys(resolvedPlugin)\n .filter(\n key =>\n key !== \"$$internal\" &&\n !PLUGIN_NON_HOOK_FIELDS.includes(\n key as ArrayValues<typeof PLUGIN_NON_HOOK_FIELDS>\n )\n )\n .reduce(\n (ret, key) =>\n extractHooks<TResolvedConfig, TSystemContext>(\n context,\n ret,\n resolvedPlugin,\n key\n ),\n this.hooks\n )\n ).reduce(\n (ret, [key, value]) => {\n if (isSetObject(value)) {\n Object.entries(value).forEach(([type, list]) => {\n ret[key] ??= {};\n ret[key][type as keyof (typeof ret)[typeof key]] =\n dedupeHooklist<PluginContext<TResolvedConfig, TSystemContext>>(\n list\n );\n });\n }\n\n return ret;\n },\n {} as Record<\n string,\n HooksList<PluginContext<TResolvedConfig, TSystemContext>>\n >\n );\n }\n }\n\n /**\n * Retrieves the hook handlers for a specific hook name\n */\n public selectHooks<TKey extends string>(\n key: TKey,\n options?: SelectHooksOptions\n ): SelectHookResult<PluginContext<TResolvedConfig, TSystemContext>, TKey> {\n const result = [] as SelectHookResult<\n PluginContext<TResolvedConfig, TSystemContext>,\n TKey\n >;\n\n if (\n isPluginHookField<PluginContext<TResolvedConfig, TSystemContext>>(key) &&\n this.hooks[key]\n ) {\n if (this.hooks[key]) {\n if (options?.order) {\n const mapHooksToResult = (\n hooksList: HooksListItem<\n PluginContext<TResolvedConfig, TSystemContext>,\n TKey\n >[]\n ): SelectHookResult<\n PluginContext<TResolvedConfig, TSystemContext>,\n TKey\n > =>\n hooksList.map(hook => {\n const plugin = this.plugins.find(\n p => p.name === hook.plugin.name\n );\n if (!plugin) {\n throw new Error(\n `Could not find plugin context for plugin \"${\n hook.plugin.name\n }\".`\n );\n }\n\n return {\n handler: hook.handler,\n plugin: hook.plugin,\n context: plugin.$$internal.context\n };\n });\n\n if (options?.order === \"pre\") {\n result.push(...mapHooksToResult(this.hooks[key].preOrdered ?? []));\n result.push(...mapHooksToResult(this.hooks[key].preEnforced ?? []));\n } else if (options?.order === \"post\") {\n result.push(...mapHooksToResult(this.hooks[key].postOrdered ?? []));\n result.push(\n ...mapHooksToResult(this.hooks[key].postEnforced ?? [])\n );\n } else {\n result.push(...mapHooksToResult(this.hooks[key].normal ?? []));\n }\n } else {\n result.push(...this.selectHooks(key, { order: \"pre\" }));\n result.push(...this.selectHooks(key, { order: \"normal\" }));\n result.push(...this.selectHooks(key, { order: \"post\" }));\n }\n }\n }\n\n return result;\n }\n\n /**\n * A function to add a plugin to the context and update the configuration options. This function is used internally when applying plugins to the environment, and it ensures that the plugin is added to the list of plugins in the context and that any hooks or configuration options provided by the plugin are properly integrated into the context's state.\n *\n * @remarks\n * This function is used internally when applying plugins to the environment, and it ensures that the plugin is added to the list of plugins in the context and that any hooks or configuration options provided by the plugin are properly integrated into the context's state. It should not be called directly by external code, as it is intended for internal use only and may be subject to change without warning.\n *\n * @param execution - The execution context for the build process, which provides access to the project configuration, environment, and utility functions for performing the build. The context is used to manage the state and behavior of the build process, allowing for hooks to be called at different stages of the build and for environment-specific configurations to be applied.\n * @param options - The configuration options for the plugin, which may include properties such as the plugin name, hooks, and any other relevant metadata or settings that should be associated with the plugin when it is added to the context.\n * @param config - The resolved configuration for the environment, which may include properties such as the environment name, SSR settings, and other relevant configuration options that may affect how the plugin is applied to the environment.\n * @param overriddenConfig - The configuration options that should override all other configuration sources, such as CLI flags or environment variables. This is used to ensure that certain configuration values take precedence over any other settings defined in the user configuration or environment configuration, allowing for dynamic overrides based on the execution context.\n * @returns A promise that resolves when the plugin has been added to the context and the configuration has been updated accordingly.\n */\n protected constructor(\n execution: ExecutionContext<TResolvedConfig, TSystemContext>,\n options: ExecutionOptions,\n config: TResolvedConfig,\n overriddenConfig: InferOverridableConfig<\n EnvironmentResolvedConfig<TResolvedConfig>\n >\n ) {\n super(options);\n\n this.#execution = execution;\n this.userConfig =\n config.userConfig ?? ({} as TResolvedConfig[\"userConfig\"]);\n this.inlineConfig =\n config.inlineConfig ?? ({} as TResolvedConfig[\"inlineConfig\"]);\n this.pluginConfig = config.pluginConfig ?? {};\n this.overriddenConfig = overriddenConfig;\n }\n\n /**\n * A function to merge the various configuration objects (initial, user, inline, and plugin) into a single resolved configuration object that can be used throughout the Powerlines process. This function takes into account the different sources of configuration and their respective priorities, ensuring that the final configuration reflects the intended settings for the project. The merged configuration is then returned as a new object that can be accessed through the `config` property of the context.\n *\n * @returns The merged configuration object that combines the initial, user, inline, and plugin configurations.\n */\n protected override mergeConfig(): EnvironmentResolvedConfig<TResolvedConfig> {\n return mergeConfig(\n {\n ...omit(this.environmentConfig ?? {}, [\n \"name\",\n \"ssr\",\n \"preview\",\n \"consumer\",\n \"runtime\"\n ]),\n environment: {\n name: this.environmentConfig?.name || DEFAULT_ENVIRONMENT\n },\n environmentConfig: this.environmentConfig ?? {}\n },\n super.mergeConfig()\n ) as EnvironmentResolvedConfig<TResolvedConfig>;\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAuDA,IAAa,+BAAb,MAAa,qCAIH,kBAKV;;;;CAIE,SAGI,EAAE;;;;CAKN;;;;;;;;;;CAWA,aAAoB,KAIlB,WACA,SACA,QACA,kBAGwE;EACxE,MAAM,UAAU,IAAI,6BAGlB,WAAW,SAAS,QAAQ,iBAAiB;AAC/C,QAAM,QAAQ,MAAM;AAEpB,SAAO;;;;;CAMT,AAAmB,oBACjB,EAAE;;;;CAKJ,AAAO,UAAgE,EAAE;;;;CAKzE,IAAW,KAAa;AACtB,SAAO,KAAK,OAAO,YAAY;;;;;CAMjC,IAAW,QAGT;AACA,SAAO,MAAKA;;;;;;;;;;CAWd,IAAW,qBAGT;AACA,SAAO,MAAKC;;;;;;;;CASd,MAAa,qBACX,QACe;AACf,OAAK,OAAO,MAAM;GAChB,MAAM,EAAE,UAAU,UAAU;GAC5B,SAAS,gDAAgD,aAAa,OAAO;GAC9E,CAAC;AAEF,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AK,eACH,OAAO,gBAAiB,EAAE;AAC5B,OAAK,eAAe,OAAO,gBAAgB,EAAE;AAC7C,OAAK,mBAAmB;;;;;;;CAQ1B,AAAmB,cAA0D;AAC3E,SAAO,YACL;GACE,GAAG,KAAK,KAAK,qBAAqB,EAAE,EAAE;IACpC;IACA;IACA;IACA;IACA;IACD,CAAC;GACF,aAAa,EACX,MAAM,KAAK,mBAAmB,mBAC/B;GACD,mBAAmB,KAAK,qBAAqB,EAAE;GAChD,EACD,MAAM,aAAa,CACpB"}
|
|
1
|
+
{"version":3,"file":"environment-context.mjs","names":["#hooks","#execution"],"sources":["../../src/context/environment-context.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 { omit } from \"@stryke/helpers/omit\";\nimport { isFunction } from \"@stryke/type-checks/is-function\";\nimport { isObject } from \"@stryke/type-checks/is-object\";\nimport { isSetObject } from \"@stryke/type-checks/is-set-object\";\nimport { ArrayValues } from \"@stryke/types/array\";\nimport { uuid } from \"@stryke/unique-id/uuid\";\nimport { DEFAULT_ENVIRONMENT, PLUGIN_NON_HOOK_FIELDS } from \"../constants\";\nimport { extractHooks } from \"../lib/hooks\";\nimport { resolvePlugins } from \"../lib/plugins\";\nimport {\n dedupeHooklist,\n formatConfig,\n isPlugin,\n isPluginConfig,\n isPluginHookField,\n mergeConfig\n} from \"../plugin-utils\";\nimport type {\n EnvironmentContext,\n EnvironmentPlugin,\n EnvironmentResolvedConfig,\n ExecutionContext,\n ExecutionOptions,\n HooksList,\n HooksListItem,\n InferOverridableConfig,\n Logger,\n LoggerOptions,\n PluginConfig,\n PluginContext,\n ResolvedConfig,\n SelectHookResult,\n SelectHooksOptions\n} from \"../types\";\nimport { PowerlinesContext } from \"./context\";\nimport { createPluginContext } from \"./plugin-context\";\n\nexport class PowerlinesEnvironmentContext<\n TResolvedConfig extends ResolvedConfig = ResolvedConfig,\n TSystemContext = unknown\n>\n extends PowerlinesContext<\n EnvironmentResolvedConfig<TResolvedConfig>,\n TSystemContext\n >\n implements EnvironmentContext<TResolvedConfig, TSystemContext>\n{\n /**\n * The hooks registered by plugins in this environment\n */\n #hooks: Record<\n string,\n HooksList<PluginContext<TResolvedConfig, TSystemContext>>\n > = {};\n\n /**\n * The execution context associated with this environment, which provides access to the project configuration, environment, and utility functions for performing the build. The execution context is used to manage the state and behavior of the build process across multiple environments, allowing for hooks to be called at different stages of the build and for environment-specific configurations to be applied.\n */\n #execution: ExecutionContext<TResolvedConfig, TSystemContext>;\n\n /**\n * Create a new context from the config.\n *\n * @param execution - The execution context for the build process, which provides access to the project configuration, environment, and utility functions for performing the build. The context is used to manage the state and behavior of the build process, allowing for hooks to be called at different stages of the build and for environment-specific configurations to be applied.\n * @param options - The resolved execution options.\n * @param config - The user configuration options.\n * @param overriddenConfig - The configuration options that should override all other configuration sources, such as CLI flags or environment variables. This is used to ensure that certain configuration values take precedence over any other settings defined in the user configuration or environment configuration, allowing for dynamic overrides based on the execution context.\n * @returns A promise that resolves to an instance of the PowerlinesEnvironmentContext class, initialized with the provided configuration and environment data.\n */\n public static async from<\n TResolvedConfig extends ResolvedConfig = ResolvedConfig,\n TSystemContext = unknown\n >(\n execution: ExecutionContext<TResolvedConfig, TSystemContext>,\n options: ExecutionOptions,\n config: TResolvedConfig,\n overriddenConfig: InferOverridableConfig<\n EnvironmentResolvedConfig<TResolvedConfig>\n >\n ): Promise<PowerlinesEnvironmentContext<TResolvedConfig, TSystemContext>> {\n const context = new PowerlinesEnvironmentContext<\n TResolvedConfig,\n TSystemContext\n >(execution, options, config, overriddenConfig);\n await context.init();\n\n return context;\n }\n\n /**\n * The configuration options provided by plugins added by the user (and other plugins)\n */\n protected override environmentConfig: EnvironmentResolvedConfig<TResolvedConfig>[\"environment\"] =\n {} as EnvironmentResolvedConfig<TResolvedConfig>[\"environment\"];\n\n /**\n * The list of plugins applied to this environment\n */\n public plugins: EnvironmentPlugin<TResolvedConfig, TSystemContext>[] = [];\n\n /**\n * The unique identifier of the environment associated with this context, which can be used for logging and other purposes to distinguish between different environments in the same process.\n */\n public get id(): string {\n return this.config.environment.id;\n }\n\n /**\n * The hooks registered by plugins in this environment\n */\n public get hooks(): Record<\n string,\n HooksList<PluginContext<TResolvedConfig, TSystemContext>>\n > {\n return this.#hooks;\n }\n\n /**\n * The execution context associated with this environment, which provides access to the project configuration, environment, and utility functions for performing the build. The execution context is used to manage the state and behavior of the build process across multiple environments, allowing for hooks to be called at different stages of the build and for environment-specific configurations to be applied.\n *\n * @danger\n * This field is for internal use only and should not be accessed or modified directly. It is unstable and can be changed at anytime.\n *\n * @internal\n */\n public get unstable_execution(): ExecutionContext<\n TResolvedConfig,\n TSystemContext\n > {\n return this.#execution;\n }\n\n /**\n * A setter function to populate the environment config values provided during execution of the command, such as CLI flags or other parameters that may be relevant to the command being executed. This function can be used to update the context with the environment configuration values, which may be used during the configuration resolution process to ensure that the final configuration reflects both the user configuration and any environment configuration provided during execution.\n *\n * @param config - The environment configuration values to set.\n * @returns A promise that resolves when the environment configuration values have been set.\n */\n public async setEnvironmentConfig(\n config: EnvironmentResolvedConfig<TResolvedConfig>[\"environment\"]\n ): Promise<void> {\n this.logger.debug({\n meta: { category: \"config\" },\n message: `Updating environment configuration object: \\n${formatConfig(config)}`\n });\n\n this.environmentConfig = config;\n await this.resolveConfig();\n }\n\n /**\n * Create a new logger instance\n *\n * @param options - The configuration options to use for the logger instance, which can be used to customize the appearance and behavior of the log messages generated by the logger. This is typically the name of the plugin or module that is creating the logger instance.\n * @returns A logger client instance that can be used to generate log messages with consistent formatting and metadata.\n */\n public override createLogger(options: LoggerOptions): Logger {\n return super.createLogger({\n ...options,\n environment: this.environmentConfig?.name || this.config.environment?.name\n });\n }\n\n /**\n * Extend the base logger with additional configuration options\n *\n * @param options - The configuration options to extend the base logger with, which can be used to add additional metadata or customize the appearance of log messages generated by the logger. This is typically the name of the plugin or module that is creating the logger instance, as well as any additional metadata such as the plugin category or environment.\n * @returns A new logger client instance that extends the base logger with the provided configuration options.\n */\n public override extendLogger(options: LoggerOptions): Logger {\n return super.extendLogger({\n ...options,\n environment: this.environmentConfig?.name || this.config.environment?.name\n });\n }\n\n /**\n * A function used internally to add a plugin to the context and update the configuration options\n *\n * @danger\n * This field is for internal use only and should not be accessed or modified directly. It is unstable and can be changed at anytime.\n *\n * @internal\n */\n public async unstable_addPlugin(\n plugin: PluginConfig<PluginContext<TResolvedConfig, TSystemContext>>\n ): Promise<void> {\n const plugins = await resolvePlugins<TResolvedConfig, TSystemContext>(\n this,\n plugin\n );\n for (const plugin of plugins) {\n let resolvedPlugin = plugin as EnvironmentPlugin<\n TResolvedConfig,\n TSystemContext\n >;\n if (isFunction(plugin.applyToEnvironment)) {\n const result = (await Promise.resolve(\n plugin.applyToEnvironment(this.config.environment) as Promise<any>\n )) as\n | boolean\n | PluginConfig<PluginContext<TResolvedConfig, TSystemContext>>;\n\n if (!result || (isObject(result) && Object.keys(result).length === 0)) {\n return;\n }\n\n if (\n isPluginConfig<PluginContext<TResolvedConfig, TSystemContext>>(result)\n ) {\n return this.unstable_addPlugin(result);\n }\n\n resolvedPlugin = (\n isPlugin<PluginContext<TResolvedConfig, TSystemContext>>(result)\n ? result\n : plugin\n ) as EnvironmentPlugin<TResolvedConfig, TSystemContext>;\n }\n\n const id = uuid();\n const context = createPluginContext<TResolvedConfig, TSystemContext>(\n id,\n resolvedPlugin,\n this\n );\n\n resolvedPlugin[\"~internal\"] = {\n id,\n context\n };\n\n this.plugins.push(resolvedPlugin);\n\n this.#hooks = Object.entries(\n Object.keys(resolvedPlugin)\n .filter(\n key =>\n key !== \"~internal\" &&\n !PLUGIN_NON_HOOK_FIELDS.includes(\n key as ArrayValues<typeof PLUGIN_NON_HOOK_FIELDS>\n )\n )\n .reduce(\n (ret, key) =>\n extractHooks<TResolvedConfig, TSystemContext>(\n context,\n ret,\n resolvedPlugin,\n key\n ),\n this.hooks\n )\n ).reduce(\n (ret, [key, value]) => {\n if (isSetObject(value)) {\n Object.entries(value).forEach(([type, list]) => {\n ret[key] ??= {};\n ret[key][type as keyof (typeof ret)[typeof key]] =\n dedupeHooklist<PluginContext<TResolvedConfig, TSystemContext>>(\n list\n );\n });\n }\n\n return ret;\n },\n {} as Record<\n string,\n HooksList<PluginContext<TResolvedConfig, TSystemContext>>\n >\n );\n }\n }\n\n /**\n * Retrieves the hook handlers for a specific hook name\n */\n public selectHooks<TKey extends string>(\n key: TKey,\n options?: SelectHooksOptions\n ): SelectHookResult<PluginContext<TResolvedConfig, TSystemContext>, TKey> {\n const result = [] as SelectHookResult<\n PluginContext<TResolvedConfig, TSystemContext>,\n TKey\n >;\n\n if (\n isPluginHookField<PluginContext<TResolvedConfig, TSystemContext>>(key) &&\n this.hooks[key]\n ) {\n if (this.hooks[key]) {\n if (options?.order) {\n const mapHooksToResult = (\n hooksList: HooksListItem<\n PluginContext<TResolvedConfig, TSystemContext>,\n TKey\n >[]\n ): SelectHookResult<\n PluginContext<TResolvedConfig, TSystemContext>,\n TKey\n > =>\n hooksList.map(hook => {\n const plugin = this.plugins.find(\n p => p.name === hook.plugin.name\n );\n if (!plugin) {\n throw new Error(\n `Could not find plugin context for plugin \"${\n hook.plugin.name\n }\".`\n );\n }\n\n return {\n handler: hook.handler,\n plugin: hook.plugin,\n context: plugin[\"~internal\"].context\n };\n });\n\n if (options?.order === \"pre\") {\n result.push(...mapHooksToResult(this.hooks[key].preOrdered ?? []));\n result.push(...mapHooksToResult(this.hooks[key].preEnforced ?? []));\n } else if (options?.order === \"post\") {\n result.push(...mapHooksToResult(this.hooks[key].postOrdered ?? []));\n result.push(\n ...mapHooksToResult(this.hooks[key].postEnforced ?? [])\n );\n } else {\n result.push(...mapHooksToResult(this.hooks[key].normal ?? []));\n }\n } else {\n result.push(...this.selectHooks(key, { order: \"pre\" }));\n result.push(...this.selectHooks(key, { order: \"normal\" }));\n result.push(...this.selectHooks(key, { order: \"post\" }));\n }\n }\n }\n\n return result;\n }\n\n /**\n * A function to add a plugin to the context and update the configuration options. This function is used internally when applying plugins to the environment, and it ensures that the plugin is added to the list of plugins in the context and that any hooks or configuration options provided by the plugin are properly integrated into the context's state.\n *\n * @remarks\n * This function is used internally when applying plugins to the environment, and it ensures that the plugin is added to the list of plugins in the context and that any hooks or configuration options provided by the plugin are properly integrated into the context's state. It should not be called directly by external code, as it is intended for internal use only and may be subject to change without warning.\n *\n * @param execution - The execution context for the build process, which provides access to the project configuration, environment, and utility functions for performing the build. The context is used to manage the state and behavior of the build process, allowing for hooks to be called at different stages of the build and for environment-specific configurations to be applied.\n * @param options - The configuration options for the plugin, which may include properties such as the plugin name, hooks, and any other relevant metadata or settings that should be associated with the plugin when it is added to the context.\n * @param config - The resolved configuration for the environment, which may include properties such as the environment name, SSR settings, and other relevant configuration options that may affect how the plugin is applied to the environment.\n * @param overriddenConfig - The configuration options that should override all other configuration sources, such as CLI flags or environment variables. This is used to ensure that certain configuration values take precedence over any other settings defined in the user configuration or environment configuration, allowing for dynamic overrides based on the execution context.\n * @returns A promise that resolves when the plugin has been added to the context and the configuration has been updated accordingly.\n */\n protected constructor(\n execution: ExecutionContext<TResolvedConfig, TSystemContext>,\n options: ExecutionOptions,\n config: TResolvedConfig,\n overriddenConfig: InferOverridableConfig<\n EnvironmentResolvedConfig<TResolvedConfig>\n >\n ) {\n super(options);\n\n this.#execution = execution;\n this.userConfig =\n config.userConfig ?? ({} as TResolvedConfig[\"userConfig\"]);\n this.inlineConfig =\n config.inlineConfig ?? ({} as TResolvedConfig[\"inlineConfig\"]);\n this.pluginConfig = config.pluginConfig ?? {};\n this.overriddenConfig = overriddenConfig;\n }\n\n /**\n * A function to merge the various configuration objects (initial, user, inline, and plugin) into a single resolved configuration object that can be used throughout the Powerlines process. This function takes into account the different sources of configuration and their respective priorities, ensuring that the final configuration reflects the intended settings for the project. The merged configuration is then returned as a new object that can be accessed through the `config` property of the context.\n *\n * @returns The merged configuration object that combines the initial, user, inline, and plugin configurations.\n */\n protected override mergeConfig(): EnvironmentResolvedConfig<TResolvedConfig> {\n return mergeConfig(\n {\n ...omit(this.environmentConfig ?? {}, [\n \"name\",\n \"ssr\",\n \"preview\",\n \"consumer\",\n \"runtime\"\n ]),\n environment: {\n name: this.environmentConfig?.name || DEFAULT_ENVIRONMENT\n },\n environmentConfig: this.environmentConfig ?? {}\n },\n super.mergeConfig()\n ) as EnvironmentResolvedConfig<TResolvedConfig>;\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAuDA,IAAa,+BAAb,MAAa,qCAIH,kBAKV;;;;CAIE,SAGI,EAAE;;;;CAKN;;;;;;;;;;CAWA,aAAoB,KAIlB,WACA,SACA,QACA,kBAGwE;EACxE,MAAM,UAAU,IAAI,6BAGlB,WAAW,SAAS,QAAQ,iBAAiB;AAC/C,QAAM,QAAQ,MAAM;AAEpB,SAAO;;;;;CAMT,AAAmB,oBACjB,EAAE;;;;CAKJ,AAAO,UAAgE,EAAE;;;;CAKzE,IAAW,KAAa;AACtB,SAAO,KAAK,OAAO,YAAY;;;;;CAMjC,IAAW,QAGT;AACA,SAAO,MAAKA;;;;;;;;;;CAWd,IAAW,qBAGT;AACA,SAAO,MAAKC;;;;;;;;CASd,MAAa,qBACX,QACe;AACf,OAAK,OAAO,MAAM;GAChB,MAAM,EAAE,UAAU,UAAU;GAC5B,SAAS,gDAAgD,aAAa,OAAO;GAC9E,CAAC;AAEF,OAAK,oBAAoB;AACzB,QAAM,KAAK,eAAe;;;;;;;;CAS5B,AAAgB,aAAa,SAAgC;AAC3D,SAAO,MAAM,aAAa;GACxB,GAAG;GACH,aAAa,K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E,SAAO,YACL;GACE,GAAG,KAAK,KAAK,qBAAqB,EAAE,EAAE;IACpC;IACA;IACA;IACA;IACA;IACD,CAAC;GACF,aAAa,EACX,MAAM,KAAK,mBAAmB,mBAC/B;GACD,mBAAmB,KAAK,qBAAqB,EAAE;GAChD,EACD,MAAM,aAAa,CACpB"}
|
package/dist/lib/entry.d.cts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { UnresolvedContext } from "../types/context.cjs";
|
|
2
2
|
import { Config, ResolvedEntryTypeDefinition } from "../types/config.cjs";
|
|
3
3
|
import { TypeDefinition, TypeDefinitionParameter } from "@stryke/types/configuration";
|
|
4
4
|
|
|
5
5
|
//#region src/lib/entry.d.ts
|
|
6
|
-
declare function resolveEntryOutput(context:
|
|
7
|
-
declare function resolveInput(context:
|
|
6
|
+
declare function resolveEntryOutput<TContext extends UnresolvedContext>(context: TContext, typeDefinition: TypeDefinition): string;
|
|
7
|
+
declare function resolveInput<TContext extends UnresolvedContext>(context: TContext, typeDefinition: TypeDefinition, input?: TypeDefinitionParameter, output?: string): ResolvedEntryTypeDefinition;
|
|
8
8
|
/**
|
|
9
9
|
* Resolves multiple type definitions into their corresponding resolved entry type definitions.
|
|
10
10
|
*
|
|
@@ -12,7 +12,7 @@ declare function resolveInput(context: Context, typeDefinition: TypeDefinition,
|
|
|
12
12
|
* @param typeDefinitions - The type definitions to resolve.
|
|
13
13
|
* @returns A promise that resolves to an array of resolved entry type definitions.
|
|
14
14
|
*/
|
|
15
|
-
declare function resolveInputs(context:
|
|
15
|
+
declare function resolveInputs<TContext extends UnresolvedContext>(context: TContext, typeDefinitions: TypeDefinitionParameter | TypeDefinitionParameter[] | Record<string, TypeDefinitionParameter | TypeDefinitionParameter[]>): Promise<ResolvedEntryTypeDefinition[]>;
|
|
16
16
|
/**
|
|
17
17
|
* Resolves multiple type definitions into their corresponding resolved entry type definitions.
|
|
18
18
|
*
|
|
@@ -20,7 +20,7 @@ declare function resolveInputs(context: Context, typeDefinitions: TypeDefinition
|
|
|
20
20
|
* @param typeDefinitions - The type definitions to resolve.
|
|
21
21
|
* @returns A promise that resolves to an array of resolved entry type definitions.
|
|
22
22
|
*/
|
|
23
|
-
declare function resolveInputsSync(context:
|
|
23
|
+
declare function resolveInputsSync<TContext extends UnresolvedContext>(context: TContext, typeDefinitions: TypeDefinitionParameter | TypeDefinitionParameter[] | Record<string, TypeDefinitionParameter | TypeDefinitionParameter[]>): ResolvedEntryTypeDefinition[];
|
|
24
24
|
/**
|
|
25
25
|
* Checks if the provided entry is a type definition.
|
|
26
26
|
*
|
package/dist/lib/entry.d.cts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"entry.d.cts","names":[],"sources":["../../src/lib/entry.ts"],"mappings":";;;;;iBAqCgB,kBAAA,
|
|
1
|
+
{"version":3,"file":"entry.d.cts","names":[],"sources":["../../src/lib/entry.ts"],"mappings":";;;;;iBAqCgB,kBAAA,kBAAoC,iBAAA,CAAA,CAClD,OAAA,EAAS,QAAA,EACT,cAAA,EAAgB,cAAA;AAAA,iBAsBF,YAAA,kBAA8B,iBAAA,CAAA,CAC5C,OAAA,EAAS,QAAA,EACT,cAAA,EAAgB,cAAA,EAChB,KAAA,GAAQ,uBAAA,EACR,MAAA,YACC,2BAAA;AA7BH;;;;;;;AAAA,iBA4CsB,aAAA,kBAA+B,iBAAA,CAAA,CACnD,OAAA,EAAS,QAAA,EACT,eAAA,EACI,uBAAA,GACA,uBAAA,KACA,MAAA,SAAe,uBAAA,GAA0B,uBAAA,MAC5C,OAAA,CAAQ,2BAAA;;;;;;;;iBAyEK,iBAAA,kBAAmC,iBAAA,CAAA,CACjD,OAAA,EAAS,QAAA,EACT,eAAA,EACI,uBAAA,GACA,uBAAA,KACA,MAAA,SAAe,uBAAA,GAA0B,uBAAA,MAC5C,2BAAA;AAzGH;;;;;;AAAA,iBAiKgB,gBAAA,CAAiB,KAAA,QAAa,KAAA,IAAS,cAAA;;;;;;;iBAUvC,6BAAA,CACd,KAAA,EAAO,uBAAA,GAA0B,2BAAA,GAChC,KAAA,IAAS,2BAAA;;;;;;;iBAaI,eAAA,CAAgB,MAAA,GAAQ,MAAA,YAAuB,MAAA"}
|
package/dist/lib/entry.d.mts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { UnresolvedContext } from "../types/context.mjs";
|
|
2
2
|
import { Config, ResolvedEntryTypeDefinition } from "../types/config.mjs";
|
|
3
3
|
import { TypeDefinition, TypeDefinitionParameter } from "@stryke/types/configuration";
|
|
4
4
|
|
|
5
5
|
//#region src/lib/entry.d.ts
|
|
6
|
-
declare function resolveEntryOutput(context:
|
|
7
|
-
declare function resolveInput(context:
|
|
6
|
+
declare function resolveEntryOutput<TContext extends UnresolvedContext>(context: TContext, typeDefinition: TypeDefinition): string;
|
|
7
|
+
declare function resolveInput<TContext extends UnresolvedContext>(context: TContext, typeDefinition: TypeDefinition, input?: TypeDefinitionParameter, output?: string): ResolvedEntryTypeDefinition;
|
|
8
8
|
/**
|
|
9
9
|
* Resolves multiple type definitions into their corresponding resolved entry type definitions.
|
|
10
10
|
*
|
|
@@ -12,7 +12,7 @@ declare function resolveInput(context: Context, typeDefinition: TypeDefinition,
|
|
|
12
12
|
* @param typeDefinitions - The type definitions to resolve.
|
|
13
13
|
* @returns A promise that resolves to an array of resolved entry type definitions.
|
|
14
14
|
*/
|
|
15
|
-
declare function resolveInputs(context:
|
|
15
|
+
declare function resolveInputs<TContext extends UnresolvedContext>(context: TContext, typeDefinitions: TypeDefinitionParameter | TypeDefinitionParameter[] | Record<string, TypeDefinitionParameter | TypeDefinitionParameter[]>): Promise<ResolvedEntryTypeDefinition[]>;
|
|
16
16
|
/**
|
|
17
17
|
* Resolves multiple type definitions into their corresponding resolved entry type definitions.
|
|
18
18
|
*
|
|
@@ -20,7 +20,7 @@ declare function resolveInputs(context: Context, typeDefinitions: TypeDefinition
|
|
|
20
20
|
* @param typeDefinitions - The type definitions to resolve.
|
|
21
21
|
* @returns A promise that resolves to an array of resolved entry type definitions.
|
|
22
22
|
*/
|
|
23
|
-
declare function resolveInputsSync(context:
|
|
23
|
+
declare function resolveInputsSync<TContext extends UnresolvedContext>(context: TContext, typeDefinitions: TypeDefinitionParameter | TypeDefinitionParameter[] | Record<string, TypeDefinitionParameter | TypeDefinitionParameter[]>): ResolvedEntryTypeDefinition[];
|
|
24
24
|
/**
|
|
25
25
|
* Checks if the provided entry is a type definition.
|
|
26
26
|
*
|
package/dist/lib/entry.d.mts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"entry.d.mts","names":[],"sources":["../../src/lib/entry.ts"],"mappings":";;;;;iBAqCgB,kBAAA,
|
|
1
|
+
{"version":3,"file":"entry.d.mts","names":[],"sources":["../../src/lib/entry.ts"],"mappings":";;;;;iBAqCgB,kBAAA,kBAAoC,iBAAA,CAAA,CAClD,OAAA,EAAS,QAAA,EACT,cAAA,EAAgB,cAAA;AAAA,iBAsBF,YAAA,kBAA8B,iBAAA,CAAA,CAC5C,OAAA,EAAS,QAAA,EACT,cAAA,EAAgB,cAAA,EAChB,KAAA,GAAQ,uBAAA,EACR,MAAA,YACC,2BAAA;AA7BH;;;;;;;AAAA,iBA4CsB,aAAA,kBAA+B,iBAAA,CAAA,CACnD,OAAA,EAAS,QAAA,EACT,eAAA,EACI,uBAAA,GACA,uBAAA,KACA,MAAA,SAAe,uBAAA,GAA0B,uBAAA,MAC5C,OAAA,CAAQ,2BAAA;;;;;;;;iBAyEK,iBAAA,kBAAmC,iBAAA,CAAA,CACjD,OAAA,EAAS,QAAA,EACT,eAAA,EACI,uBAAA,GACA,uBAAA,KACA,MAAA,SAAe,uBAAA,GAA0B,uBAAA,MAC5C,2BAAA;AAzGH;;;;;;AAAA,iBAiKgB,gBAAA,CAAiB,KAAA,QAAa,KAAA,IAAS,cAAA;;;;;;;iBAUvC,6BAAA,CACd,KAAA,EAAO,uBAAA,GAA0B,2BAAA,GAChC,KAAA,IAAS,2BAAA;;;;;;;iBAaI,eAAA,CAAgB,MAAA,GAAQ,MAAA,YAAuB,MAAA"}
|
package/dist/lib/entry.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"entry.mjs","names":[],"sources":["../../src/lib/entry.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 { parseTypeDefinition } from \"@stryke/convert/parse-type-definition\";\nimport { toArray } from \"@stryke/convert/to-array\";\nimport { murmurhash } from \"@stryke/hash\";\nimport { getUniqueBy } from \"@stryke/helpers/get-unique\";\nimport { appendPath } from \"@stryke/path/append\";\nimport { isAbsolutePath } from \"@stryke/path/is-type\";\nimport { joinPaths } from \"@stryke/path/join-paths\";\nimport { replaceExtension, replacePath } from \"@stryke/path/replace\";\nimport { isObject } from \"@stryke/type-checks/is-object\";\nimport { isSetString } from \"@stryke/type-checks/is-set-string\";\nimport { isString } from \"@stryke/type-checks/is-string\";\nimport type {\n TypeDefinition,\n TypeDefinitionParameter\n} from \"@stryke/types/configuration\";\nimport { replacePathTokens } from \"../plugin-utils/paths\";\nimport { Config, ResolvedEntryTypeDefinition } from \"../types/config\";\nimport type { Context } from \"../types/context\";\n\nexport function resolveEntryOutput(\n context: Context,\n typeDefinition: TypeDefinition\n): string {\n return replaceExtension(\n replacePath(\n replacePath(\n replacePath(\n replacePath(\n replacePath(\n typeDefinition.file,\n joinPaths(context.config.cwd, context.config.root, \"src\")\n ),\n joinPaths(context.config.cwd, context.config.root)\n ),\n joinPaths(context.config.root, \"src\")\n ),\n context.config.root\n ),\n \"src\"\n )\n );\n}\n\nexport function resolveInput(\n context: Context,\n typeDefinition: TypeDefinition,\n input?: TypeDefinitionParameter,\n output?: string\n): ResolvedEntryTypeDefinition {\n return {\n ...typeDefinition,\n input: isSetString(input) ? { file: String(input) } : typeDefinition,\n output: output || resolveEntryOutput(context, typeDefinition)\n };\n}\n\n/**\n * Resolves multiple type definitions into their corresponding resolved entry type definitions.\n *\n * @param context - The current context\n * @param typeDefinitions - The type definitions to resolve.\n * @returns A promise that resolves to an array of resolved entry type definitions.\n */\nexport async function resolveInputs(\n context: Context,\n typeDefinitions:\n | TypeDefinitionParameter\n | TypeDefinitionParameter[]\n | Record<string, TypeDefinitionParameter | TypeDefinitionParameter[]>\n): Promise<ResolvedEntryTypeDefinition[]> {\n return (\n await Promise.all(\n (isObject(typeDefinitions) && !isTypeDefinition(typeDefinitions)\n ? Object.values(typeDefinitions).flat()\n : toArray(typeDefinitions)\n )\n .map(async entry => {\n if (isResolvedEntryTypeDefinition(entry)) {\n return {\n ...entry,\n output: entry.output\n ? replacePathTokens(context, entry.output)\n : undefined,\n file: replacePathTokens(context, entry.file)\n };\n }\n\n let typeDefinition: TypeDefinition;\n if (isString(entry)) {\n typeDefinition = parseTypeDefinition(\n replacePathTokens(context, entry)\n )!;\n } else {\n typeDefinition = entry;\n typeDefinition.file = replacePathTokens(\n context,\n typeDefinition.file\n );\n }\n\n const filePath = isAbsolutePath(typeDefinition.file)\n ? typeDefinition.file\n : appendPath(typeDefinition.file, context.config.root);\n if (await context.fs.isFile(filePath)) {\n return resolveInput(\n context,\n {\n file: replacePath(filePath, context.config.root),\n name: typeDefinition.name\n },\n (entry as ResolvedEntryTypeDefinition).input,\n (entry as ResolvedEntryTypeDefinition).output\n );\n }\n\n return (\n await context.fs.glob(appendPath(filePath, context.config.cwd))\n ).map(file =>\n resolveInput(\n context,\n {\n file: replacePath(file, context.config.root),\n name: typeDefinition.name\n },\n (entry as ResolvedEntryTypeDefinition).input,\n (entry as ResolvedEntryTypeDefinition).output\n )\n );\n })\n .flat()\n .filter(Boolean)\n )\n ).flat();\n}\n\n/**\n * Resolves multiple type definitions into their corresponding resolved entry type definitions.\n *\n * @param context - The current context\n * @param typeDefinitions - The type definitions to resolve.\n * @returns A promise that resolves to an array of resolved entry type definitions.\n */\nexport function resolveInputsSync(\n context: Context,\n typeDefinitions:\n | TypeDefinitionParameter\n | TypeDefinitionParameter[]\n | Record<string, TypeDefinitionParameter | TypeDefinitionParameter[]>\n): ResolvedEntryTypeDefinition[] {\n return (\n isObject(typeDefinitions) && !isTypeDefinition(typeDefinitions)\n ? Object.values(typeDefinitions).flat()\n : toArray(typeDefinitions)\n )\n .map(entry => {\n if (isResolvedEntryTypeDefinition(entry)) {\n return {\n ...entry,\n output: entry.output\n ? replacePathTokens(context, entry.output)\n : undefined,\n file: replacePathTokens(context, entry.file)\n };\n }\n\n let typeDefinition: TypeDefinition;\n if (isString(entry)) {\n typeDefinition = parseTypeDefinition(\n replacePathTokens(context, entry)\n )!;\n } else {\n typeDefinition = entry;\n typeDefinition.file = replacePathTokens(context, typeDefinition.file);\n }\n\n const filePath = isAbsolutePath(typeDefinition.file)\n ? typeDefinition.file\n : appendPath(typeDefinition.file, context.config.root);\n if (context.fs.isFileSync(filePath)) {\n return resolveInput(context, {\n file: appendPath(filePath, context.config.cwd),\n name: typeDefinition.name\n });\n }\n\n return context.fs\n .globSync(appendPath(filePath, context.config.cwd))\n .map(file =>\n resolveInput(context, {\n file,\n name: typeDefinition.name\n })\n );\n })\n .flat()\n .filter(Boolean);\n}\n\n/**\n * Checks if the provided entry is a type definition.\n *\n * @param entry - The entry to check.\n * @returns True if the entry is a type definition, false otherwise.\n */\nexport function isTypeDefinition(entry: any): entry is TypeDefinition {\n return !isString(entry) && entry.file !== undefined;\n}\n\n/**\n * Checks if the provided entry is a resolved entry type definition.\n *\n * @param entry - The entry to check.\n * @returns True if the entry is a resolved entry type definition, false otherwise.\n */\nexport function isResolvedEntryTypeDefinition(\n entry: TypeDefinitionParameter | ResolvedEntryTypeDefinition\n): entry is ResolvedEntryTypeDefinition {\n return (\n isTypeDefinition(entry) &&\n (entry as ResolvedEntryTypeDefinition).output !== undefined\n );\n}\n\n/**\n * Get unique inputs from the provided list.\n *\n * @param inputs - The entry points to process.\n * @returns An array of unique inputs (by file path or content hash).\n */\nexport function getUniqueInputs(inputs: Config[\"input\"] = []): Config[\"input\"] {\n return isObject(inputs)\n ? inputs\n : getUniqueBy(toArray(inputs), (item: TypeDefinitionParameter) =>\n isSetString(item) ? item : murmurhash(item ?? {}, { maxLength: 24 })\n );\n}\n"],"mappings":";;;;;;;;;;;;;;AAqCA,SAAgB,mBACd,SACA,gBACQ;AACR,QAAO,iBACL,YACE,YACE,YACE,YACE,YACE,eAAe,MACf,UAAU,QAAQ,OAAO,KAAK,QAAQ,OAAO,MAAM,MAAM,CAC1D,EACD,UAAU,QAAQ,OAAO,KAAK,QAAQ,OAAO,KAAK,CACnD,EACD,UAAU,QAAQ,OAAO,MAAM,MAAM,CACtC,EACD,QAAQ,OAAO,KAChB,EACD,MACD,CACF;;AAGH,SAAgB,aACd,SACA,gBACA,OACA,QAC6B;AAC7B,QAAO;EACL,GAAG;EACH,OAAO,YAAY,MAAM,GAAG,EAAE,MAAM,OAAO,MAAM,EAAE,GAAG;EACtD,QAAQ,UAAU,mBAAmB,SAAS,eAAe;EAC9D;;;;;;;;;AAUH,eAAsB,cACpB,SACA,iBAIwC;AACxC,SACE,MAAM,QAAQ,KACX,SAAS,gBAAgB,IAAI,CAAC,iBAAiB,gBAAgB,GAC5D,OAAO,OAAO,gBAAgB,CAAC,MAAM,GACrC,QAAQ,gBAAgB,EAEzB,IAAI,OAAM,UAAS;AAClB,MAAI,8BAA8B,MAAM,CACtC,QAAO;GACL,GAAG;GACH,QAAQ,MAAM,SACV,kBAAkB,SAAS,MAAM,OAAO,GACxC;GACJ,MAAM,kBAAkB,SAAS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AAO,KAAK;AACxD,MAAI,QAAQ,GAAG,WAAW,SAAS,CACjC,QAAO,aAAa,SAAS;GAC3B,MAAM,WAAW,UAAU,QAAQ,OAAO,IAAI;GAC9C,MAAM,eAAe;GACtB,CAAC;AAGJ,SAAO,QAAQ,GACZ,SAAS,WAAW,UAAU,QAAQ,OAAO,IAAI,CAAC,CAClD,KAAI,SACH,aAAa,SAAS;GACpB;GACA,MAAM,eAAe;GACtB,CAAC,CACH;GACH,CACD,MAAM,CACN,OAAO,QAAQ;;;;;;;;AASpB,SAAgB,iBAAiB,OAAqC;AACpE,QAAO,CAAC,SAAS,MAAM,IAAI,MAAM,SAAS;;;;;;;;AAS5C,SAAgB,8BACd,OACsC;AACtC,QACE,iBAAiB,MAAM,IACtB,MAAsC,WAAW;;;;;;;;AAUtD,SAAgB,gBAAgB,SAA0B,EAAE,EAAmB;AAC7E,QAAO,SAAS,OAAO,GACnB,SACA,YAAY,QAAQ,OAAO,GAAG,SAC5B,YAAY,KAAK,GAAG,OAAO,WAAW,QAAQ,EAAE,EAAE,EAAE,WAAW,IAAI,CAAC,CACrE"}
|
|
1
|
+
{"version":3,"file":"entry.mjs","names":[],"sources":["../../src/lib/entry.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 { parseTypeDefinition } from \"@stryke/convert/parse-type-definition\";\nimport { toArray } from \"@stryke/convert/to-array\";\nimport { murmurhash } from \"@stryke/hash\";\nimport { getUniqueBy } from \"@stryke/helpers/get-unique\";\nimport { appendPath } from \"@stryke/path/append\";\nimport { isAbsolutePath } from \"@stryke/path/is-type\";\nimport { joinPaths } from \"@stryke/path/join-paths\";\nimport { replaceExtension, replacePath } from \"@stryke/path/replace\";\nimport { isObject } from \"@stryke/type-checks/is-object\";\nimport { isSetString } from \"@stryke/type-checks/is-set-string\";\nimport { isString } from \"@stryke/type-checks/is-string\";\nimport type {\n TypeDefinition,\n TypeDefinitionParameter\n} from \"@stryke/types/configuration\";\nimport { replacePathTokens } from \"../plugin-utils/paths\";\nimport { Config, ResolvedEntryTypeDefinition } from \"../types/config\";\nimport type { UnresolvedContext } from \"../types/context\";\n\nexport function resolveEntryOutput<TContext extends UnresolvedContext>(\n context: TContext,\n typeDefinition: TypeDefinition\n): string {\n return replaceExtension(\n replacePath(\n replacePath(\n replacePath(\n replacePath(\n replacePath(\n typeDefinition.file,\n joinPaths(context.config.cwd, context.config.root, \"src\")\n ),\n joinPaths(context.config.cwd, context.config.root)\n ),\n joinPaths(context.config.root, \"src\")\n ),\n context.config.root\n ),\n \"src\"\n )\n );\n}\n\nexport function resolveInput<TContext extends UnresolvedContext>(\n context: TContext,\n typeDefinition: TypeDefinition,\n input?: TypeDefinitionParameter,\n output?: string\n): ResolvedEntryTypeDefinition {\n return {\n ...typeDefinition,\n input: isSetString(input) ? { file: String(input) } : typeDefinition,\n output: output || resolveEntryOutput(context, typeDefinition)\n };\n}\n\n/**\n * Resolves multiple type definitions into their corresponding resolved entry type definitions.\n *\n * @param context - The current context\n * @param typeDefinitions - The type definitions to resolve.\n * @returns A promise that resolves to an array of resolved entry type definitions.\n */\nexport async function resolveInputs<TContext extends UnresolvedContext>(\n context: TContext,\n typeDefinitions:\n | TypeDefinitionParameter\n | TypeDefinitionParameter[]\n | Record<string, TypeDefinitionParameter | TypeDefinitionParameter[]>\n): Promise<ResolvedEntryTypeDefinition[]> {\n return (\n await Promise.all(\n (isObject(typeDefinitions) && !isTypeDefinition(typeDefinitions)\n ? Object.values(typeDefinitions).flat()\n : toArray(typeDefinitions)\n )\n .map(async entry => {\n if (isResolvedEntryTypeDefinition(entry)) {\n return {\n ...entry,\n output: entry.output\n ? replacePathTokens(context, entry.output)\n : undefined,\n file: replacePathTokens(context, entry.file)\n };\n }\n\n let typeDefinition: TypeDefinition;\n if (isString(entry)) {\n typeDefinition = parseTypeDefinition(\n replacePathTokens(context, entry)\n )!;\n } else {\n typeDefinition = entry;\n typeDefinition.file = replacePathTokens(\n context,\n typeDefinition.file\n );\n }\n\n const filePath = isAbsolutePath(typeDefinition.file)\n ? typeDefinition.file\n : appendPath(typeDefinition.file, context.config.root);\n if (await context.fs.isFile(filePath)) {\n return resolveInput(\n context,\n {\n file: replacePath(filePath, context.config.root),\n name: typeDefinition.name\n },\n (entry as ResolvedEntryTypeDefinition).input,\n (entry as ResolvedEntryTypeDefinition).output\n );\n }\n\n return (\n await context.fs.glob(appendPath(filePath, context.config.cwd))\n ).map(file =>\n resolveInput(\n context,\n {\n file: replacePath(file, context.config.root),\n name: typeDefinition.name\n },\n (entry as ResolvedEntryTypeDefinition).input,\n (entry as ResolvedEntryTypeDefinition).output\n )\n );\n })\n .flat()\n .filter(Boolean)\n )\n ).flat();\n}\n\n/**\n * Resolves multiple type definitions into their corresponding resolved entry type definitions.\n *\n * @param context - The current context\n * @param typeDefinitions - The type definitions to resolve.\n * @returns A promise that resolves to an array of resolved entry type definitions.\n */\nexport function resolveInputsSync<TContext extends UnresolvedContext>(\n context: TContext,\n typeDefinitions:\n | TypeDefinitionParameter\n | TypeDefinitionParameter[]\n | Record<string, TypeDefinitionParameter | TypeDefinitionParameter[]>\n): ResolvedEntryTypeDefinition[] {\n return (\n isObject(typeDefinitions) && !isTypeDefinition(typeDefinitions)\n ? Object.values(typeDefinitions).flat()\n : toArray(typeDefinitions)\n )\n .map(entry => {\n if (isResolvedEntryTypeDefinition(entry)) {\n return {\n ...entry,\n output: entry.output\n ? replacePathTokens(context, entry.output)\n : undefined,\n file: replacePathTokens(context, entry.file)\n };\n }\n\n let typeDefinition: TypeDefinition;\n if (isString(entry)) {\n typeDefinition = parseTypeDefinition(\n replacePathTokens(context, entry)\n )!;\n } else {\n typeDefinition = entry;\n typeDefinition.file = replacePathTokens(context, typeDefinition.file);\n }\n\n const filePath = isAbsolutePath(typeDefinition.file)\n ? typeDefinition.file\n : appendPath(typeDefinition.file, context.config.root);\n if (context.fs.isFileSync(filePath)) {\n return resolveInput(context, {\n file: appendPath(filePath, context.config.cwd),\n name: typeDefinition.name\n });\n }\n\n return context.fs\n .globSync(appendPath(filePath, context.config.cwd))\n .map(file =>\n resolveInput(context, {\n file,\n name: typeDefinition.name\n })\n );\n })\n .flat()\n .filter(Boolean);\n}\n\n/**\n * Checks if the provided entry is a type definition.\n *\n * @param entry - The entry to check.\n * @returns True if the entry is a type definition, false otherwise.\n */\nexport function isTypeDefinition(entry: any): entry is TypeDefinition {\n return !isString(entry) && entry.file !== undefined;\n}\n\n/**\n * Checks if the provided entry is a resolved entry type definition.\n *\n * @param entry - The entry to check.\n * @returns True if the entry is a resolved entry type definition, false otherwise.\n */\nexport function isResolvedEntryTypeDefinition(\n entry: TypeDefinitionParameter | ResolvedEntryTypeDefinition\n): entry is ResolvedEntryTypeDefinition {\n return (\n isTypeDefinition(entry) &&\n (entry as ResolvedEntryTypeDefinition).output !== undefined\n );\n}\n\n/**\n * Get unique inputs from the provided list.\n *\n * @param inputs - The entry points to process.\n * @returns An array of unique inputs (by file path or content hash).\n */\nexport function getUniqueInputs(inputs: Config[\"input\"] = []): Config[\"input\"] {\n return isObject(inputs)\n ? inputs\n : getUniqueBy(toArray(inputs), (item: TypeDefinitionParameter) =>\n isSetString(item) ? item : murmurhash(item ?? {}, { maxLength: 24 })\n );\n}\n"],"mappings":";;;;;;;;;;;;;;AAqCA,SAAgB,mBACd,SACA,gBACQ;AACR,QAAO,iBACL,YACE,YACE,YACE,YACE,YACE,eAAe,MACf,UAAU,QAAQ,OAAO,KAAK,QAAQ,OAAO,MAAM,MAAM,CAC1D,EACD,UAAU,QAAQ,OAAO,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KAAK,GAAG,OAAO,WAAW,QAAQ,EAAE,EAAE,EAAE,WAAW,IAAI,CAAC,CACrE"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ResolveOptions } from "../../types/fs.cjs";
|
|
2
|
-
import {
|
|
2
|
+
import { UnresolvedContext } from "../../types/context.cjs";
|
|
3
3
|
import { UnpluginOptions } from "unplugin";
|
|
4
4
|
|
|
5
5
|
//#region src/lib/unplugin/module-resolution.d.ts
|
|
@@ -35,7 +35,7 @@ interface CreateUnpluginModuleResolutionFunctionsOptions {
|
|
|
35
35
|
* @param options - Options for creating the module resolution functions.
|
|
36
36
|
* @returns The module resolution hooks (`resolveId` and `load`).
|
|
37
37
|
*/
|
|
38
|
-
declare function createUnpluginModuleResolutionFunctions<TContext extends
|
|
38
|
+
declare function createUnpluginModuleResolutionFunctions<TContext extends UnresolvedContext>(context: TContext, options?: CreateUnpluginModuleResolutionFunctionsOptions): Pick<UnpluginOptions, "resolveId" | "load">;
|
|
39
39
|
declare type __ΩCreateUnpluginModuleResolutionFunctionsOptions = any[];
|
|
40
40
|
//#endregion
|
|
41
41
|
export { CreateUnpluginModuleResolutionFunctionsOptions, __ΩCreateUnpluginModuleResolutionFunctionsOptions, createUnpluginModuleResolutionFunctions };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"module-resolution.d.cts","names":[],"sources":["../../../src/lib/unplugin/module-resolution.ts"],"mappings":";;;;;UAmCiB,8CAAA;;AAAjB;;;;;;;;EAUE,MAAA;EAQkC;AAgBpC;;;;;EAhBE,SAAA,GAAY,OAAA,CAAQ,cAAA;AAAA;;;;;;;;;;;;;;iBAgBN,uCAAA,kBACG,
|
|
1
|
+
{"version":3,"file":"module-resolution.d.cts","names":[],"sources":["../../../src/lib/unplugin/module-resolution.ts"],"mappings":";;;;;UAmCiB,8CAAA;;AAAjB;;;;;;;;EAUE,MAAA;EAQkC;AAgBpC;;;;;EAhBE,SAAA,GAAY,OAAA,CAAQ,cAAA;AAAA;;;;;;;;;;;;;;iBAgBN,uCAAA,kBACG,iBAAA,CAAA,CAEjB,OAAA,EAAS,QAAA,EACT,OAAA,GAAS,8CAAA,GACR,IAAA,CAAK,eAAA;AAAA"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ResolveOptions } from "../../types/fs.mjs";
|
|
2
|
-
import {
|
|
2
|
+
import { UnresolvedContext } from "../../types/context.mjs";
|
|
3
3
|
import { UnpluginOptions } from "unplugin";
|
|
4
4
|
|
|
5
5
|
//#region src/lib/unplugin/module-resolution.d.ts
|
|
@@ -35,7 +35,7 @@ interface CreateUnpluginModuleResolutionFunctionsOptions {
|
|
|
35
35
|
* @param options - Options for creating the module resolution functions.
|
|
36
36
|
* @returns The module resolution hooks (`resolveId` and `load`).
|
|
37
37
|
*/
|
|
38
|
-
declare function createUnpluginModuleResolutionFunctions<TContext extends
|
|
38
|
+
declare function createUnpluginModuleResolutionFunctions<TContext extends UnresolvedContext>(context: TContext, options?: CreateUnpluginModuleResolutionFunctionsOptions): Pick<UnpluginOptions, "resolveId" | "load">;
|
|
39
39
|
declare type __ΩCreateUnpluginModuleResolutionFunctionsOptions = any[];
|
|
40
40
|
//#endregion
|
|
41
41
|
export { CreateUnpluginModuleResolutionFunctionsOptions, __ΩCreateUnpluginModuleResolutionFunctionsOptions, createUnpluginModuleResolutionFunctions };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"module-resolution.d.mts","names":[],"sources":["../../../src/lib/unplugin/module-resolution.ts"],"mappings":";;;;;UAmCiB,8CAAA;;AAAjB;;;;;;;;EAUE,MAAA;EAQkC;AAgBpC;;;;;EAhBE,SAAA,GAAY,OAAA,CAAQ,cAAA;AAAA;;;;;;;;;;;;;;iBAgBN,uCAAA,kBACG,
|
|
1
|
+
{"version":3,"file":"module-resolution.d.mts","names":[],"sources":["../../../src/lib/unplugin/module-resolution.ts"],"mappings":";;;;;UAmCiB,8CAAA;;AAAjB;;;;;;;;EAUE,MAAA;EAQkC;AAgBpC;;;;;EAhBE,SAAA,GAAY,OAAA,CAAQ,cAAA;AAAA;;;;;;;;;;;;;;iBAgBN,uCAAA,kBACG,iBAAA,CAAA,CAEjB,OAAA,EAAS,QAAA,EACT,OAAA,GAAS,8CAAA,GACR,IAAA,CAAK,eAAA;AAAA"}
|
|
@@ -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 {\n addVirtualPrefix,\n removeVirtualPrefix,\n VIRTUAL_MODULE_PREFIX_REGEX\n} from \"../../plugin-utils\";\nimport {
|
|
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 {\n addVirtualPrefix,\n removeVirtualPrefix,\n VIRTUAL_MODULE_PREFIX_REGEX\n} from \"../../plugin-utils\";\nimport { ResolveResult, UnresolvedContext } 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\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 UnresolvedContext\n>(\n context: TContext,\n options: CreateUnpluginModuleResolutionFunctionsOptions = {}\n): Pick<UnpluginOptions, \"resolveId\" | \"load\"> {\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 = removeVirtualPrefix(id);\n const normalizedImporter = importer\n ? removeVirtualPrefix(importer)\n : undefined;\n\n let result = await context.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 ? addVirtualPrefix(result.id)\n : result.id\n };\n }\n\n result = await context.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 ? addVirtualPrefix(result.id)\n : result.id\n };\n }\n\n result = await context.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 ? addVirtualPrefix(result.id)\n : result.id\n };\n }\n\n result = await context.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 ? addVirtualPrefix(result.id)\n : result.id\n };\n }\n\n return null;\n },\n load: {\n filter:\n options.prefix !== false\n ? {\n id: VIRTUAL_MODULE_PREFIX_REGEX\n }\n : undefined,\n async handler(\n this: UnpluginBuildContext & UnpluginContext,\n id: string\n ): Promise<LoadResult | null | undefined> {\n const normalizedId = removeVirtualPrefix(id);\n\n let result = await context.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 context.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 context.load(normalizedId);\n if (result) {\n return result;\n }\n\n return context.callHook(\n \"load\",\n {\n sequential: true,\n result: \"first\",\n order: \"post\"\n },\n normalizedId\n );\n }\n }\n };\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAqEA,SAAgB,wCAGd,SACA,UAA0D,EAAE,EACf;AAC7C,QAAO;EACL,MAAM,UAEJ,IACA,UACA,OAEI,EAAE,SAAS,OAAO,EAC8B;GACpD,MAAM,eAAe,oBAAoB,GAAG;GAC5C,MAAM,qBAAqB,WACvB,oBAAoB,SAAS,GAC7B;GAEJ,IAAI,SAAS,MAAM,QAAQ,SACzB,aACA;IACE,YAAY;IACZ,QAAQ;IACR,OAAO;IACR,EACD,cACA,oBACA,KACD;AACD,OAAI,YAAY,OAAO,CACrB,QAAO;YACE,YAAY,OAAO,CAC5B,QAAO;IACL,GAAG;IACH,IACE,OAAO,WAAW,QAAQ,WAAW,QACjC,iBAAiB,OAAO,GAAG,GAC3B,OAAO;IACd;AAGH,YAAS,MAAM,QAAQ,SACrB,aACA;IACE,YAAY;IACZ,QAAQ;IACR,OAAO;IACR,EACD,cACA,oBACA,KACD;AACD,OAAI,YAAY,OAAO,CACrB,QAAO;YACE,YAAY,OAAO,CAC5B,QAAO;IACL,GAAG;IACH,IACE,OAAO,WAAW,QAAQ,WAAW,QACjC,iBAAiB,OAAO,GAAG,GAC3B,OAAO;IACd;AAGH,YAAS,MAAM,QAAQ,QACrB,cACA,oBACA,KAAK,QAAQ,aAAa,EAAE,EAAE;IAC5B,QAAQ;IACR,GAAG;IACJ,CAAC,CACH;AACD,OAAI,YAAY,OAAO,CACrB,QAAO;IACL,GAAG;IACH,IACE,OAAO,WAAW,QAAQ,WAAW,QACjC,iBAAiB,OAAO,GAAG,GAC3B,OAAO;IACd;AAGH,YAAS,MAAM,QAAQ,SACrB,aACA;IACE,YAAY;IACZ,QAAQ;IACR,OAAO;IACR,EACD,cACA,oBACA,KACD;AACD,OAAI,YAAY,OAAO,CACrB,QAAO;YACE,YAAY,OAAO,CAC5B,QAAO;IACL,GAAG;IACH,IACE,OAAO,WAAW,QAAQ,WAAW,QACjC,iBAAiB,OAAO,GAAG,GAC3B,OAAO;IACd;AAGH,UAAO;;EAET,MAAM;GACJ,QACE,QAAQ,WAAW,QACf,EACE,IAAI,6BACL,GACD;GACN,MAAM,QAEJ,IACwC;IACxC,MAAM,eAAe,oBAAoB,GAAG;IAE5C,IAAI,SAAS,MAAM,QAAQ,SACzB,QACA;KACE,YAAY;KACZ,QAAQ;KACR,OAAO;KACR,EACD,aACD;AACD,QAAI,OACF,QAAO;AAGT,aAAS,MAAM,QAAQ,SACrB,QACA;KACE,YAAY;KACZ,QAAQ;KACR,OAAO;KACR,EACD,aACD;AACD,QAAI,OACF,QAAO;AAGT,aAAS,MAAM,QAAQ,KAAK,aAAa;AACzC,QAAI,OACF,QAAO;AAGT,WAAO,QAAQ,SACb,QACA;KACE,YAAY;KACZ,QAAQ;KACR,OAAO;KACR,EACD,aACD;;GAEJ;EACF"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { UnpluginOptions } from "../../types/unplugin.cjs";
|
|
2
|
-
import { PluginContext } from "../../types/context.cjs";
|
|
2
|
+
import { PluginContext, UnresolvedContext } from "../../types/context.cjs";
|
|
3
3
|
import { CreateUnpluginModuleResolutionFunctionsOptions } from "./module-resolution.cjs";
|
|
4
4
|
|
|
5
5
|
//#region src/lib/unplugin/plugin.d.ts
|
|
@@ -26,7 +26,7 @@ interface CreateUnpluginResolverOptions extends CreateUnpluginModuleResolutionFu
|
|
|
26
26
|
* @param context - The plugin context.
|
|
27
27
|
* @returns The unplugin instance.
|
|
28
28
|
*/
|
|
29
|
-
declare function createUnpluginResolver<TContext extends
|
|
29
|
+
declare function createUnpluginResolver<TContext extends UnresolvedContext>(context: TContext, options?: CreateUnpluginResolverOptions): () => UnpluginOptions<TContext>;
|
|
30
30
|
interface CreateUnpluginOptions extends CreateUnpluginResolverOptions {}
|
|
31
31
|
/**
|
|
32
32
|
* Creates a Powerlines unplugin instance.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plugin.d.cts","names":[],"sources":["../../../src/lib/unplugin/plugin.ts"],"mappings":";;;;;UAoCiB,6BAAA,SAAsC,8CAAA;;AAAvD;;;;;;;EASE,IAAA;EAOkB;AASpB;;;;EATE,kBAAA;AAAA;;;;;;;iBASc,sBAAA,
|
|
1
|
+
{"version":3,"file":"plugin.d.cts","names":[],"sources":["../../../src/lib/unplugin/plugin.ts"],"mappings":";;;;;UAoCiB,6BAAA,SAAsC,8CAAA;;AAAvD;;;;;;;EASE,IAAA;EAOkB;AASpB;;;;EATE,kBAAA;AAAA;;;;;;;iBASc,sBAAA,kBAAwC,iBAAA,CAAA,CACtD,OAAA,EAAS,QAAA,EACT,OAAA,GAAS,6BAAA,SACF,eAAA,CAAgB,QAAA;AAAA,UA8BR,qBAAA,SAA8B,6BAAA;;;;;;AAA/C;iBAQgB,cAAA,kBAAgC,aAAA,GAAgB,aAAA,CAAA,CAC9D,OAAA,EAAS,QAAA,EACT,OAAA,GAAS,qBAAA,SACF,eAAA,CAAgB,QAAA;AAAA"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { UnpluginOptions } from "../../types/unplugin.mjs";
|
|
2
|
-
import { PluginContext } from "../../types/context.mjs";
|
|
2
|
+
import { PluginContext, UnresolvedContext } from "../../types/context.mjs";
|
|
3
3
|
import { CreateUnpluginModuleResolutionFunctionsOptions } from "./module-resolution.mjs";
|
|
4
4
|
|
|
5
5
|
//#region src/lib/unplugin/plugin.d.ts
|
|
@@ -26,7 +26,7 @@ interface CreateUnpluginResolverOptions extends CreateUnpluginModuleResolutionFu
|
|
|
26
26
|
* @param context - The plugin context.
|
|
27
27
|
* @returns The unplugin instance.
|
|
28
28
|
*/
|
|
29
|
-
declare function createUnpluginResolver<TContext extends
|
|
29
|
+
declare function createUnpluginResolver<TContext extends UnresolvedContext>(context: TContext, options?: CreateUnpluginResolverOptions): () => UnpluginOptions<TContext>;
|
|
30
30
|
interface CreateUnpluginOptions extends CreateUnpluginResolverOptions {}
|
|
31
31
|
/**
|
|
32
32
|
* Creates a Powerlines unplugin instance.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plugin.d.mts","names":[],"sources":["../../../src/lib/unplugin/plugin.ts"],"mappings":";;;;;UAoCiB,6BAAA,SAAsC,8CAAA;;AAAvD;;;;;;;EASE,IAAA;EAOkB;AASpB;;;;EATE,kBAAA;AAAA;;;;;;;iBASc,sBAAA,
|
|
1
|
+
{"version":3,"file":"plugin.d.mts","names":[],"sources":["../../../src/lib/unplugin/plugin.ts"],"mappings":";;;;;UAoCiB,6BAAA,SAAsC,8CAAA;;AAAvD;;;;;;;EASE,IAAA;EAOkB;AASpB;;;;EATE,kBAAA;AAAA;;;;;;;iBASc,sBAAA,kBAAwC,iBAAA,CAAA,CACtD,OAAA,EAAS,QAAA,EACT,OAAA,GAAS,6BAAA,SACF,eAAA,CAAgB,QAAA;AAAA,UA8BR,qBAAA,SAA8B,6BAAA;;;;;;AAA/C;iBAQgB,cAAA,kBAAgC,aAAA,GAAgB,aAAA,CAAA,CAC9D,OAAA,EAAS,QAAA,EACT,OAAA,GAAS,qBAAA,SACF,eAAA,CAAgB,QAAA;AAAA"}
|
|
@@ -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 { 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 { removeVirtualPrefix } from \"../../plugin-utils\";\nimport type { PluginContext } from \"../../types/context\";\nimport type { UnpluginOptions } from \"../../types/unplugin\";\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 * 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 createUnpluginResolver
|
|
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 { 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 { removeVirtualPrefix } from \"../../plugin-utils\";\nimport type { PluginContext, UnresolvedContext } from \"../../types/context\";\nimport type { UnpluginOptions } from \"../../types/unplugin\";\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 * 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 createUnpluginResolver<TContext extends UnresolvedContext>(\n context: TContext,\n options: CreateUnpluginResolverOptions = {}\n): () => UnpluginOptions<TContext> {\n setParseImpl(context.parse);\n\n const name = options.name || \"powerlines\";\n\n const logger = context.extendLogger(\n !options.silenceHookLogging && name !== \"powerlines\" ? { source: name } : {}\n );\n logger.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 context,\n resolveId,\n load\n });\n } catch (error) {\n logger.error(error instanceof Error ? error.message : String(error));\n\n throw error;\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): () => UnpluginOptions<TContext> {\n setParseImpl(context.parse.bind(context));\n\n const name = options.name || \"powerlines\";\n\n const logger = context.extendLogger(\n !options.silenceHookLogging && name !== \"powerlines\" ? { source: name } : {}\n );\n logger.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 logger.debug(\"Powerlines build plugin starting...\");\n }\n\n await context.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 context.environment.selectHooks(\"transform\")) {\n const result: TransformResult | string | undefined =\n await hook.handler.apply(combineContexts(context, this), [\n getString(transformed),\n removeVirtualPrefix(id)\n ] as [code: string, id: string]);\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 logger.debug(\"Powerlines build plugin finishing...\");\n }\n\n return context.callHook(\"buildEnd\", {\n sequential: true\n });\n }\n\n async function writeBundle(): Promise<void> {\n if (!options.silenceHookLogging) {\n logger.debug(\"Finalizing Powerlines project output...\");\n }\n\n return context.callHook(\"writeBundle\", {\n sequential: true\n });\n }\n\n return () => ({\n name:\n name.toLowerCase() === \"powerlines\"\n ? \"powerlines\"\n : `powerlines:${kebabCase(name)}`,\n context,\n resolveId,\n load,\n transform,\n buildStart,\n buildEnd,\n writeBundle,\n vite: {\n sharedDuringBuild: true\n }\n });\n } catch (error) {\n logger.error(error instanceof Error ? error.message : String(error));\n\n throw error;\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;AA6DA,SAAgB,uBACd,SACA,UAAyC,EAAE,EACV;AACjC,cAAa,QAAQ,MAAM;CAE3B,MAAM,OAAO,QAAQ,QAAQ;CAE7B,MAAM,SAAS,QAAQ,aACrB,CAAC,QAAQ,sBAAsB,SAAS,eAAe,EAAE,QAAQ,MAAM,GAAG,EAAE,CAC7E;AACD,QAAO,MAAM,gBAAgB,UAAU,KAAK,CAAC,SAAS;AAEtD,KAAI;EACF,MAAM,EAAE,WAAW,SACjB,wCAAkD,SAAS,QAAQ;AAErE,gBAAc;GACZ,MACE,KAAK,aAAa,KAAK,eACnB,eACA,cAAc,UAAU,KAAK;GACnC;GACA;GACA;GACD;UACM,OAAO;AACd,SAAO,MAAM,iBAAiB,QAAQ,MAAM,UAAU,OAAO,MAAM,CAAC;AAEpE,QAAM;;;;;;;;;AAYV,SAAgB,eACd,SACA,UAAiC,EAAE,EACF;AACjC,cAAa,QAAQ,MAAM,KAAK,QAAQ,CAAC;CAEzC,MAAM,OAAO,QAAQ,QAAQ;CAE7B,MAAM,SAAS,QAAQ,aACrB,CAAC,QAAQ,sBAAsB,SAAS,eAAe,EAAE,QAAQ,MAAM,GAAG,EAAE,CAC7E;AACD,QAAO,MAAM,gBAAgB,UAAU,KAAK,CAAC,SAAS;AAEtD,KAAI;EACF,MAAM,EAAE,WAAW,SACjB,wCAAkD,SAAS,QAAQ;EAErE,eAAe,aAAuC;AACpD,OAAI,CAAC,QAAQ,mBACX,QAAO,MAAM,sCAAsC;AAGrD,SAAM,QAAQ,SAAS,cAAc,EACnC,YAAY,MACb,CAAC;;EAGJ,eAAe,UAEb,MACA,IAC6C;GAC7C,IAAI,cAAwC;AAE5C,QAAK,MAAM,QAAQ,QAAQ,YAAY,YAAY,YAAY,EAAE;IAC/D,MAAM,SACJ,MAAM,KAAK,QAAQ,MAAM,gBAAgB,SAAS,KAAK,EAAE,CACvD,UAAU,YAAY,EACtB,oBAAoB,GAAG,CACxB,CAA+B;AAClC,QAAI,OACF,eAAc;;AAIlB,UAAO;;EAGT,eAAe,WAAoD;AACjE,OAAI,CAAC,QAAQ,mBACX,QAAO,MAAM,uCAAuC;AAGtD,UAAO,QAAQ,SAAS,YAAY,EAClC,YAAY,MACb,CAAC;;EAGJ,eAAe,cAA6B;AAC1C,OAAI,CAAC,QAAQ,mBACX,QAAO,MAAM,0CAA0C;AAGzD,UAAO,QAAQ,SAAS,eAAe,EACrC,YAAY,MACb,CAAC;;AAGJ,gBAAc;GACZ,MACE,KAAK,aAAa,KAAK,eACnB,eACA,cAAc,UAAU,KAAK;GACnC;GACA;GACA;GACA;GACA;GACA;GACA;GACA,MAAM,EACJ,mBAAmB,MACpB;GACF;UACM,OAAO;AACd,SAAO,MAAM,iBAAiB,QAAQ,MAAM,UAAU,OAAO,MAAM,CAAC;AAEpE,QAAM"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { UnresolvedContext } from "../types/context.cjs";
|
|
2
2
|
import { ResolveConfig } from "../types/config.cjs";
|
|
3
3
|
|
|
4
4
|
//#region src/plugin-utils/build-helpers.d.ts
|
|
@@ -12,7 +12,7 @@ interface GetDependencyConfigResult {
|
|
|
12
12
|
* @param context - The build context.
|
|
13
13
|
* @returns The dependency configuration.
|
|
14
14
|
*/
|
|
15
|
-
declare function getDependencyConfig(context:
|
|
15
|
+
declare function getDependencyConfig<TContext extends UnresolvedContext>(context: TContext): GetDependencyConfigResult;
|
|
16
16
|
declare type __ΩGetDependencyConfigResult = any[];
|
|
17
17
|
//#endregion
|
|
18
18
|
export { GetDependencyConfigResult, __ΩGetDependencyConfigResult, getDependencyConfig };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"build-helpers.d.cts","names":[],"sources":["../../src/plugin-utils/build-helpers.ts"],"mappings":";;;;UAyBiB,yBAAA;EACf,QAAA,EAAU,aAAA;EACV,UAAA,EAAY,aAAA;AAAA;;;;;;;iBASE,mBAAA,
|
|
1
|
+
{"version":3,"file":"build-helpers.d.cts","names":[],"sources":["../../src/plugin-utils/build-helpers.ts"],"mappings":";;;;UAyBiB,yBAAA;EACf,QAAA,EAAU,aAAA;EACV,UAAA,EAAY,aAAA;AAAA;;;;;;;iBASE,mBAAA,kBAAqC,iBAAA,CAAA,CACnD,OAAA,EAAS,QAAA,GACR,yBAAA;AAAA"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { UnresolvedContext } from "../types/context.mjs";
|
|
2
2
|
import { ResolveConfig } from "../types/config.mjs";
|
|
3
3
|
|
|
4
4
|
//#region src/plugin-utils/build-helpers.d.ts
|
|
@@ -12,7 +12,7 @@ interface GetDependencyConfigResult {
|
|
|
12
12
|
* @param context - The build context.
|
|
13
13
|
* @returns The dependency configuration.
|
|
14
14
|
*/
|
|
15
|
-
declare function getDependencyConfig(context:
|
|
15
|
+
declare function getDependencyConfig<TContext extends UnresolvedContext>(context: TContext): GetDependencyConfigResult;
|
|
16
16
|
declare type __ΩGetDependencyConfigResult = any[];
|
|
17
17
|
//#endregion
|
|
18
18
|
export { GetDependencyConfigResult, __ΩGetDependencyConfigResult, getDependencyConfig };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"build-helpers.d.mts","names":[],"sources":["../../src/plugin-utils/build-helpers.ts"],"mappings":";;;;UAyBiB,yBAAA;EACf,QAAA,EAAU,aAAA;EACV,UAAA,EAAY,aAAA;AAAA;;;;;;;iBASE,mBAAA,
|
|
1
|
+
{"version":3,"file":"build-helpers.d.mts","names":[],"sources":["../../src/plugin-utils/build-helpers.ts"],"mappings":";;;;UAyBiB,yBAAA;EACf,QAAA,EAAU,aAAA;EACV,UAAA,EAAY,aAAA;AAAA;;;;;;;iBASE,mBAAA,kBAAqC,iBAAA,CAAA,CACnD,OAAA,EAAS,QAAA,GACR,yBAAA;AAAA"}
|
|
@@ -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 {
|
|
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 { UnresolvedContext } 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<TContext extends UnresolvedContext>(\n context: TContext\n): GetDependencyConfigResult {\n const noExternal = getUnique(\n toArray(context.config.resolve.noExternal).concat(\n context.builtins.map(\n builtin =>\n `${context.config.framework?.name ?? \"powerlines\"}:${builtin}`\n )\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,KACf,YACE,GAAG,QAAQ,OAAO,WAAW,QAAQ,aAAa,GAAG,UACxD,CACF,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"}
|
package/dist/types/context.d.cts
CHANGED
|
@@ -5,7 +5,6 @@ import { LogFn, LogMessage, Logger, LoggerOptions } from "./logging.cjs";
|
|
|
5
5
|
import { ParsedTypeScriptConfig } from "./tsconfig.cjs";
|
|
6
6
|
import { EnvironmentResolvedConfig, ExecutionOptions, Options, PluginConfig, ResolvedConfig, ResolvedEntryTypeDefinition } from "./config.cjs";
|
|
7
7
|
import { EnvPaths } from "@stryke/env/get-env-paths";
|
|
8
|
-
import { DeepReadonly } from "@stryke/types/base";
|
|
9
8
|
import { FetchRequestOptions } from "@stryke/http/fetch";
|
|
10
9
|
import { PackageJson } from "@stryke/types/package-json";
|
|
11
10
|
import { Jiti } from "jiti";
|
|
@@ -228,20 +227,7 @@ interface UnresolvedContext<TResolvedConfig extends ResolvedConfig = ResolvedCon
|
|
|
228
227
|
/**
|
|
229
228
|
* An object containing the options provided to Powerlines
|
|
230
229
|
*/
|
|
231
|
-
config: Omit<TResolvedConfig
|
|
232
|
-
/**
|
|
233
|
-
* The output configuration options for the Powerlines process, which may include settings related to the output directory, file naming conventions, and other options that affect how the compiled output is generated and structured. This is typically derived from the user configuration but may also include additional options provided by plugins or other sources.
|
|
234
|
-
*/
|
|
235
|
-
output: TResolvedConfig["output"];
|
|
236
|
-
/**
|
|
237
|
-
* The configuration values read from the user configuration file before any resolution or merging with default values or plugin-provided configurations. This represents the raw configuration as defined by the user, and can be useful for debugging or for plugins that need to access the original configuration values before they are processed by Powerlines.
|
|
238
|
-
*/
|
|
239
|
-
readonly userConfig: DeepReadonly<TResolvedConfig["userConfig"]>;
|
|
240
|
-
/**
|
|
241
|
-
* The configuration options that were provided inline to the Powerlines CLI.
|
|
242
|
-
*/
|
|
243
|
-
readonly inlineConfig: DeepReadonly<TResolvedConfig["inlineConfig"]>;
|
|
244
|
-
};
|
|
230
|
+
config: Omit<TResolvedConfig, "pluginConfig">;
|
|
245
231
|
/**
|
|
246
232
|
* A place to store metadata information on the context for access in plugins and other parts of the system. This can be used to store information about the current execution, such as a unique identifier for the execution, timestamps, or any other relevant data that may be useful for plugins or other parts of the system to access during the build process.
|
|
247
233
|
*/
|
|
@@ -605,7 +591,7 @@ interface EnvironmentPlugin<TResolvedConfig extends ResolvedConfig = ResolvedCon
|
|
|
605
591
|
*
|
|
606
592
|
* @internal
|
|
607
593
|
*/
|
|
608
|
-
|
|
594
|
+
"~internal": {
|
|
609
595
|
/**
|
|
610
596
|
* The unique identifier of the plugin, which can be used for logging and other purposes to distinguish between different plugins in the same process.
|
|
611
597
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"context.d.cts","names":[],"sources":["../../src/types/context.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"context.d.cts","names":[],"sources":["../../src/types/context.ts"],"mappings":";;;;;;;;;;;;;;;;;;KAsDY,QAAA,GAAW,MAAA;EAAX;;;EAIV,QAAA;EAJqB;;;EASrB,WAAA;E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GAAiB,IAAA;EAxCjC;;AAEvC;;;;;;EAgDE,kBAAA,GACE,MAAA,EAAQ,YAAA,CAAa,aAAA,CAAc,eAAA,EAAiB,cAAA,OACjD,OAAA;AAAA;AAAA,UAGU,aAAA,6BACa,cAAA,GAAiB,cAAA,oCAErC,OAAA,CAAQ,yBAAA,CAA0B,eAAA,GAAkB,cAAA;EAzChB;;;EAAA,SA6CnC,EAAA;EAxCQ;;;EAAA,SA6CR,WAAA,EAAa,kBAAA;AAAA;AAAA,KAGZ,kBAAA,yBACc,cAAA,GAAiB,cAAA,IACvC,oBAAA,GAAuB,aAAA,CAAc,eAAA;AAAA,KAE7B,wBAAA,kBAA0C,aAAA,IACpD,oBAAA,GAAuB,QAAA;AAAA"}
|
package/dist/types/context.d.mts
CHANGED
|
@@ -11,7 +11,6 @@ import MagicString, { SourceMap } from "magic-string";
|
|
|
11
11
|
import { FetchRequestOptions } from "@stryke/http/fetch";
|
|
12
12
|
import { ParseResult, ParserOptions } from "oxc-parser";
|
|
13
13
|
import { RequestInfo, Response } from "undici";
|
|
14
|
-
import { DeepReadonly } from "@stryke/types/base";
|
|
15
14
|
import { PackageJson } from "@stryke/types/package-json";
|
|
16
15
|
import { Range } from "semver";
|
|
17
16
|
import { Unimport } from "unimport";
|
|
@@ -228,20 +227,7 @@ interface UnresolvedContext<TResolvedConfig extends ResolvedConfig = ResolvedCon
|
|
|
228
227
|
/**
|
|
229
228
|
* An object containing the options provided to Powerlines
|
|
230
229
|
*/
|
|
231
|
-
config: Omit<TResolvedConfig
|
|
232
|
-
/**
|
|
233
|
-
* The output configuration options for the Powerlines process, which may include settings related to the output directory, file naming conventions, and other options that affect how the compiled output is generated and structured. This is typically derived from the user configuration but may also include additional options provided by plugins or other sources.
|
|
234
|
-
*/
|
|
235
|
-
output: TResolvedConfig["output"];
|
|
236
|
-
/**
|
|
237
|
-
* The configuration values read from the user configuration file before any resolution or merging with default values or plugin-provided configurations. This represents the raw configuration as defined by the user, and can be useful for debugging or for plugins that need to access the original configuration values before they are processed by Powerlines.
|
|
238
|
-
*/
|
|
239
|
-
readonly userConfig: DeepReadonly<TResolvedConfig["userConfig"]>;
|
|
240
|
-
/**
|
|
241
|
-
* The configuration options that were provided inline to the Powerlines CLI.
|
|
242
|
-
*/
|
|
243
|
-
readonly inlineConfig: DeepReadonly<TResolvedConfig["inlineConfig"]>;
|
|
244
|
-
};
|
|
230
|
+
config: Omit<TResolvedConfig, "pluginConfig">;
|
|
245
231
|
/**
|
|
246
232
|
* A place to store metadata information on the context for access in plugins and other parts of the system. This can be used to store information about the current execution, such as a unique identifier for the execution, timestamps, or any other relevant data that may be useful for plugins or other parts of the system to access during the build process.
|
|
247
233
|
*/
|
|
@@ -605,7 +591,7 @@ interface EnvironmentPlugin<TResolvedConfig extends ResolvedConfig = ResolvedCon
|
|
|
605
591
|
*
|
|
606
592
|
* @internal
|
|
607
593
|
*/
|
|
608
|
-
|
|
594
|
+
"~internal": {
|
|
609
595
|
/**
|
|
610
596
|
* The unique identifier of the plugin, which can be used for logging and other purposes to distinguish between different plugins in the same process.
|
|
611
597
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"context.d.mts","names":[],"sources":["../../src/types/context.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"context.d.mts","names":[],"sources":["../../src/types/context.ts"],"mappings":";;;;;;;;;;;;;;;;;;KAsDY,QAAA,GAAW,MAAA;EAAX;;;EAIV,QAAA;EAJqB;;;EASrB,WAAA;EAUA;;;EALA,SAAA;EAeU;AAGZ;;EAbE,SAAA;EAaoC;;;EARpC,QAAA;EASY;;AAGd;EAPE,UAAA;AAAA;AAAA,UAGe,QAAA,SAAiB,IAAA;EAChC,MAAA,EAAQ,IAAA;AAAA;AAAA,UAGO,iBAAA;EACf,IAAA;EACA,GAAA,EAAK,SAAA;AAAA;;;;UAMU,UAAA;EASf;;;EALA,EAAA;EAeS;;;EAVT,IAAA,EAAM,WAAA;EAamB;;;EARzB,GAAA;EASm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AAA,KAGZ,kBAAA,yBACc,cAAA,GAAiB,cAAA,IACvC,oBAAA,GAAuB,aAAA,CAAc,eAAA;AAAA,KAE7B,wBAAA,kBAA0C,aAAA,IACpD,oBAAA,GAAuB,QAAA;AAAA"}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { PluginContext, UnresolvedContext, WithUnpluginBuildContext } from "./context.cjs";
|
|
2
2
|
import { UnpluginOptions } from "unplugin";
|
|
3
3
|
|
|
4
4
|
//#region src/types/unplugin.d.ts
|
|
5
5
|
type UnpluginBuilderVariant = "rollup" | "webpack" | "rspack" | "vite" | "esbuild" | "farm" | "unloader" | "rolldown" | "bun";
|
|
6
6
|
type BuilderVariant = UnpluginBuilderVariant | "tsup" | "tsdown" | "unbuild";
|
|
7
|
-
interface UnpluginOptions$1<TContext extends
|
|
7
|
+
interface UnpluginOptions$1<TContext extends UnresolvedContext> extends UnpluginOptions {
|
|
8
8
|
/**
|
|
9
9
|
* An API object that can be used for inter-plugin communication.
|
|
10
10
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"unplugin.d.cts","names":[],"sources":["../../src/types/unplugin.ts"],"mappings":";;;;KAyBY,sBAAA;AAAA,KAWA,cAAA,GACR,sBAAA;AAAA,UAKa,iBAAA,kBACE,
|
|
1
|
+
{"version":3,"file":"unplugin.d.cts","names":[],"sources":["../../src/types/unplugin.ts"],"mappings":";;;;KAyBY,sBAAA;AAAA,KAWA,cAAA,GACR,sBAAA;AAAA,UAKa,iBAAA,kBACE,iBAAA,UACT,eAAA;EAnBwB;;;;AAWlC;EAcE,OAAA,EAAS,QAAA;AAAA;AAAA,KAGC,qBAAA,kBACO,aAAA,GAAgB,aAAA,kCACD,sBAAA,GAC9B,sBAAA,uBACmB,QAAA,CACnB,iBAAA,CAAgB,QAAA,GAChB,uBAAA,UAAiC,QAAA,CACjC,iBAAA,CAAgB,QAAA,GAChB,uBAAA,KACA,QAAA,CACF,iBAAA,CAAgB,QAAA,GAChB,uBAAA,EAAyB,MAAA;EAGrB,OAAA;AAAA,IAEF,QAAA,WACE,IAAA,oCACG,IAAA,kDAGD,IAAA,EAAM,uBAAA,GAA0B,wBAAA,CAAyB,QAAA,MACtD,IAAA,EAAM,YAAA,KACN,cAAA,GACL,QAAA;EAAmB,OAAA;AAAA,IACjB,gBAAA,WACE,IAAA,4CACG,IAAA,kEAGD,IAAA,EAAM,+BAAA,GACJ,wBAAA,CAAyB,QAAA,MACxB,IAAA,EAAM,oBAAA,KACN,sBAAA;AAAA"}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { PluginContext, UnresolvedContext, WithUnpluginBuildContext } from "./context.mjs";
|
|
2
2
|
import { UnpluginOptions } from "unplugin";
|
|
3
3
|
|
|
4
4
|
//#region src/types/unplugin.d.ts
|
|
5
5
|
type UnpluginBuilderVariant = "rollup" | "webpack" | "rspack" | "vite" | "esbuild" | "farm" | "unloader" | "rolldown" | "bun";
|
|
6
6
|
type BuilderVariant = UnpluginBuilderVariant | "tsup" | "tsdown" | "unbuild";
|
|
7
|
-
interface UnpluginOptions$1<TContext extends
|
|
7
|
+
interface UnpluginOptions$1<TContext extends UnresolvedContext> extends UnpluginOptions {
|
|
8
8
|
/**
|
|
9
9
|
* An API object that can be used for inter-plugin communication.
|
|
10
10
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"unplugin.d.mts","names":[],"sources":["../../src/types/unplugin.ts"],"mappings":";;;;KAyBY,sBAAA;AAAA,KAWA,cAAA,GACR,sBAAA;AAAA,UAKa,iBAAA,kBACE,
|
|
1
|
+
{"version":3,"file":"unplugin.d.mts","names":[],"sources":["../../src/types/unplugin.ts"],"mappings":";;;;KAyBY,sBAAA;AAAA,KAWA,cAAA,GACR,sBAAA;AAAA,UAKa,iBAAA,kBACE,iBAAA,UACT,eAAA;EAnBwB;;;;AAWlC;EAcE,OAAA,EAAS,QAAA;AAAA;AAAA,KAGC,qBAAA,kBACO,aAAA,GAAgB,aAAA,kCACD,sBAAA,GAC9B,sBAAA,uBACmB,QAAA,CACnB,iBAAA,CAAgB,QAAA,GAChB,uBAAA,UAAiC,QAAA,CACjC,iBAAA,CAAgB,QAAA,GAChB,uBAAA,KACA,QAAA,CACF,iBAAA,CAAgB,QAAA,GAChB,uBAAA,EAAyB,MAAA;EAGrB,OAAA;AAAA,IAEF,QAAA,WACE,IAAA,oCACG,IAAA,kDAGD,IAAA,EAAM,uBAAA,GAA0B,wBAAA,CAAyB,QAAA,MACtD,IAAA,EAAM,YAAA,KACN,cAAA,GACL,QAAA;EAAmB,OAAA;AAAA,IACjB,gBAAA,WACE,IAAA,4CACG,IAAA,kEAGD,IAAA,EAAM,+BAAA,GACJ,wBAAA,CAAyB,QAAA,MACxB,IAAA,EAAM,oBAAA,KACN,sBAAA;AAAA"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@powerlines/core",
|
|
3
|
-
"version": "0.15.
|
|
3
|
+
"version": "0.15.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",
|
|
@@ -323,19 +323,19 @@
|
|
|
323
323
|
"@donedeal0/superdiff": "^3.2.0",
|
|
324
324
|
"@jridgewell/sourcemap-codec": "^1.5.5",
|
|
325
325
|
"@rolldown/pluginutils": "1.0.0-rc.18",
|
|
326
|
-
"@storm-software/config": "^1.137.
|
|
327
|
-
"@storm-software/config-tools": "^1.190.
|
|
328
|
-
"@stryke/capnp": "^0.12.
|
|
329
|
-
"@stryke/convert": "^0.7.
|
|
330
|
-
"@stryke/env": "^0.20.
|
|
331
|
-
"@stryke/fs": "^0.33.
|
|
332
|
-
"@stryke/hash": "^0.13.
|
|
333
|
-
"@stryke/helpers": "^0.10.
|
|
334
|
-
"@stryke/json": "^0.
|
|
335
|
-
"@stryke/path": "^0.29.
|
|
336
|
-
"@stryke/string-format": "^0.17.
|
|
337
|
-
"@stryke/type-checks": "^0.6.
|
|
338
|
-
"@stryke/unique-id": "^0.3.
|
|
326
|
+
"@storm-software/config": "^1.137.52",
|
|
327
|
+
"@storm-software/config-tools": "^1.190.20",
|
|
328
|
+
"@stryke/capnp": "^0.12.102",
|
|
329
|
+
"@stryke/convert": "^0.7.7",
|
|
330
|
+
"@stryke/env": "^0.20.93",
|
|
331
|
+
"@stryke/fs": "^0.33.76",
|
|
332
|
+
"@stryke/hash": "^0.13.29",
|
|
333
|
+
"@stryke/helpers": "^0.10.16",
|
|
334
|
+
"@stryke/json": "^0.15.0",
|
|
335
|
+
"@stryke/path": "^0.29.3",
|
|
336
|
+
"@stryke/string-format": "^0.17.18",
|
|
337
|
+
"@stryke/type-checks": "^0.6.9",
|
|
338
|
+
"@stryke/unique-id": "^0.3.87",
|
|
339
339
|
"birpc": "^4.0.0",
|
|
340
340
|
"bundle-require": "^5.1.0",
|
|
341
341
|
"c12": "^3.3.4",
|
|
@@ -358,11 +358,11 @@
|
|
|
358
358
|
"unplugin-combine": "^2.4.0"
|
|
359
359
|
},
|
|
360
360
|
"devDependencies": {
|
|
361
|
-
"@storm-software/testing-tools": "^1.119.
|
|
362
|
-
"@stryke/types": "^0.12.
|
|
361
|
+
"@storm-software/testing-tools": "^1.119.173",
|
|
362
|
+
"@stryke/types": "^0.12.4",
|
|
363
363
|
"@types/bun": "^1.3.14",
|
|
364
364
|
"@types/diff-match-patch": "^1.0.36",
|
|
365
|
-
"@types/node": "^25.
|
|
365
|
+
"@types/node": "^25.8.0",
|
|
366
366
|
"@types/semver": "^7.7.1",
|
|
367
367
|
"bun-types-no-globals": "^1.3.11",
|
|
368
368
|
"prettier-plugin-organize-imports": "^4.3.0",
|
|
@@ -371,5 +371,5 @@
|
|
|
371
371
|
"undici-types": "^7.25.0"
|
|
372
372
|
},
|
|
373
373
|
"publishConfig": { "access": "public" },
|
|
374
|
-
"gitHead": "
|
|
374
|
+
"gitHead": "d837b92c13beda004144068ac837d77199142056"
|
|
375
375
|
}
|