@powerlines/core 0.45.2 → 0.46.0
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/constants/virtual-modules.cjs +4 -2
- package/dist/constants/virtual-modules.d.cts +1 -1
- package/dist/constants/virtual-modules.d.cts.map +1 -1
- package/dist/constants/virtual-modules.d.mts +1 -1
- package/dist/constants/virtual-modules.d.mts.map +1 -1
- package/dist/constants/virtual-modules.mjs +4 -2
- package/dist/constants/virtual-modules.mjs.map +1 -1
- package/dist/index.d.cts +5 -5
- package/dist/index.d.mts +5 -5
- package/dist/lib/config.d.cts +2 -1
- package/dist/lib/config.d.cts.map +1 -1
- package/dist/lib/config.d.mts +2 -1
- package/dist/lib/config.d.mts.map +1 -1
- package/dist/lib/config.mjs.map +1 -1
- package/dist/lib/unplugin/module-resolution.cjs +10 -10
- package/dist/lib/unplugin/module-resolution.mjs +10 -10
- package/dist/lib/unplugin/module-resolution.mjs.map +1 -1
- package/dist/lib/unplugin/plugin.cjs +6 -6
- package/dist/lib/unplugin/plugin.mjs +6 -6
- package/dist/lib/unplugin/plugin.mjs.map +1 -1
- package/dist/plugin-utils/helpers.d.cts +10 -9
- package/dist/plugin-utils/helpers.d.cts.map +1 -1
- package/dist/plugin-utils/helpers.d.mts +10 -9
- package/dist/plugin-utils/helpers.d.mts.map +1 -1
- package/dist/plugin-utils/paths.cjs +6 -2
- package/dist/plugin-utils/paths.mjs +6 -2
- package/dist/plugin-utils/paths.mjs.map +1 -1
- package/dist/types/_internal.d.cts +3 -18
- package/dist/types/_internal.d.cts.map +1 -1
- package/dist/types/_internal.d.mts +3 -18
- package/dist/types/_internal.d.mts.map +1 -1
- package/dist/types/api.d.cts +4 -3
- package/dist/types/api.d.cts.map +1 -1
- package/dist/types/api.d.mts +4 -3
- package/dist/types/api.d.mts.map +1 -1
- package/dist/types/config.d.cts +103 -70
- package/dist/types/config.d.cts.map +1 -1
- package/dist/types/config.d.mts +103 -70
- package/dist/types/config.d.mts.map +1 -1
- package/dist/types/context.d.cts +57 -68
- package/dist/types/context.d.cts.map +1 -1
- package/dist/types/context.d.mts +57 -68
- package/dist/types/context.d.mts.map +1 -1
- package/dist/types/index.d.cts +4 -4
- package/dist/types/index.d.mts +4 -4
- package/dist/types/plugin.d.cts +3 -6
- package/dist/types/plugin.d.cts.map +1 -1
- package/dist/types/plugin.d.mts +3 -6
- package/dist/types/plugin.d.mts.map +1 -1
- package/dist/types/unplugin.d.cts +9 -9
- package/dist/types/unplugin.d.cts.map +1 -1
- package/dist/types/unplugin.d.mts +9 -9
- package/dist/types/unplugin.d.mts.map +1 -1
- package/package.json +14 -13
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
2
|
+
const require_runtime = require('../_virtual/_rolldown/runtime.cjs');
|
|
3
|
+
let _rolldown_pluginutils = require("@rolldown/pluginutils");
|
|
2
4
|
|
|
3
5
|
//#region src/constants/virtual-modules.ts
|
|
4
|
-
const VIRTUAL_MODULE_PREFIX = "
|
|
5
|
-
const VIRTUAL_MODULE_PREFIX_REGEX =
|
|
6
|
+
const VIRTUAL_MODULE_PREFIX = "\0";
|
|
7
|
+
const VIRTUAL_MODULE_PREFIX_REGEX = (0, _rolldown_pluginutils.prefixRegex)("\0");
|
|
6
8
|
|
|
7
9
|
//#endregion
|
|
8
10
|
exports.VIRTUAL_MODULE_PREFIX = VIRTUAL_MODULE_PREFIX;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
//#region src/constants/virtual-modules.d.ts
|
|
2
|
-
declare const VIRTUAL_MODULE_PREFIX = "
|
|
2
|
+
declare const VIRTUAL_MODULE_PREFIX = "\0";
|
|
3
3
|
declare const VIRTUAL_MODULE_PREFIX_REGEX: RegExp;
|
|
4
4
|
//#endregion
|
|
5
5
|
export { VIRTUAL_MODULE_PREFIX, VIRTUAL_MODULE_PREFIX_REGEX };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"virtual-modules.d.cts","names":[],"sources":["../../src/constants/virtual-modules.ts"],"mappings":";
|
|
1
|
+
{"version":3,"file":"virtual-modules.d.cts","names":[],"sources":["../../src/constants/virtual-modules.ts"],"mappings":";cAoBa,qBAAA;AAAA,cACA,2BAAA,EAA2B,MAAA"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
//#region src/constants/virtual-modules.d.ts
|
|
2
|
-
declare const VIRTUAL_MODULE_PREFIX = "
|
|
2
|
+
declare const VIRTUAL_MODULE_PREFIX = "\0";
|
|
3
3
|
declare const VIRTUAL_MODULE_PREFIX_REGEX: RegExp;
|
|
4
4
|
//#endregion
|
|
5
5
|
export { VIRTUAL_MODULE_PREFIX, VIRTUAL_MODULE_PREFIX_REGEX };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"virtual-modules.d.mts","names":[],"sources":["../../src/constants/virtual-modules.ts"],"mappings":";
|
|
1
|
+
{"version":3,"file":"virtual-modules.d.mts","names":[],"sources":["../../src/constants/virtual-modules.ts"],"mappings":";cAoBa,qBAAA;AAAA,cACA,2BAAA,EAA2B,MAAA"}
|
|
@@ -1,6 +1,8 @@
|
|
|
1
|
+
import { prefixRegex } from "@rolldown/pluginutils";
|
|
2
|
+
|
|
1
3
|
//#region src/constants/virtual-modules.ts
|
|
2
|
-
const VIRTUAL_MODULE_PREFIX = "
|
|
3
|
-
const VIRTUAL_MODULE_PREFIX_REGEX =
|
|
4
|
+
const VIRTUAL_MODULE_PREFIX = "\0";
|
|
5
|
+
const VIRTUAL_MODULE_PREFIX_REGEX = prefixRegex("\0");
|
|
4
6
|
|
|
5
7
|
//#endregion
|
|
6
8
|
export { VIRTUAL_MODULE_PREFIX, VIRTUAL_MODULE_PREFIX_REGEX };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"virtual-modules.mjs","names":[],"sources":["../../src/constants/virtual-modules.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\nexport const VIRTUAL_MODULE_PREFIX = \"
|
|
1
|
+
{"version":3,"file":"virtual-modules.mjs","names":[],"sources":["../../src/constants/virtual-modules.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 { prefixRegex } from \"@rolldown/pluginutils\";\n\nexport const VIRTUAL_MODULE_PREFIX = \"\\0\";\nexport const VIRTUAL_MODULE_PREFIX_REGEX = prefixRegex(\"\\0\");\n"],"mappings":";;;AAoBA,MAAa,wBAAwB;AACrC,MAAa,8BAA8B,YAAY,KAAK"}
|
package/dist/index.d.cts
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import { ResolveOptions, StorageAdapter, StoragePort, StoragePreset, VirtualFile, VirtualFileData, VirtualFileExtension, VirtualFileMetadata, VirtualFileSystemInterface, WriteData, WriteOptions, __ΩResolveOptions, __ΩStorageAdapter, __ΩStoragePort, __ΩStoragePreset, __ΩVirtualFile, __ΩVirtualFileData, __ΩVirtualFileExtension, __ΩVirtualFileMetadata, __ΩVirtualFileSystemInterface, __ΩWriteData, __ΩWriteOptions } from "./types/fs.cjs";
|
|
2
1
|
import { BaseCommandType, CommandType, Commands, __ΩBaseCommandType, __ΩCommandType, __ΩCommands } from "./types/commands.cjs";
|
|
3
|
-
import { WorkerProcess, __ΩWorkerProcess } from "./types/utils.cjs";
|
|
4
|
-
import { API, APIFunctions, BaseAPIFunctions, Engine, Execution, ExecutionWorkerParams, ExecutionWorkerProcess, SupportedCommands, __ΩAPI, __ΩAPIFunctions, __ΩBaseAPIFunctions, __ΩEngine, __ΩExecution, __ΩExecutionWorkerParams, __ΩExecutionWorkerProcess, __ΩSupportedCommands } from "./types/api.cjs";
|
|
5
2
|
import { BuilderVariant, InferUnpluginOptions, InferUnpluginVariant, UnpluginAsyncFactory, UnpluginBuilderVariant, UnpluginFactory, UnpluginHookFunctions, UnpluginInitialConfig, UnpluginOptions, __ΩBuilderVariant, __ΩInferUnpluginOptions, __ΩInferUnpluginVariant, __ΩUnpluginAsyncFactory, __ΩUnpluginBuilderVariant, __ΩUnpluginFactory, __ΩUnpluginHookFunctions, __ΩUnpluginInitialConfig, __ΩUnpluginOptions } from "./types/unplugin.cjs";
|
|
6
3
|
import { BasePlugin, HookFunctions, Hooks, Plugin, PluginHook, PluginHookFields, PluginHookObject, PluginHooks, PluginNonHookFields, TypesResult, __ΩBasePlugin, __ΩHookFunctions, __ΩHooks, __ΩPlugin, __ΩPluginHook, __ΩPluginHookFields, __ΩPluginHookObject, __ΩPluginHooks, __ΩPluginNonHookFields, __ΩTypesResult } from "./types/plugin.cjs";
|
|
7
4
|
import { CallHookOptions, HookListOrders, HooksList, HooksListItem, InferHookFunction, InferHookParameters, InferHookReturnType, InferHookThisType, NormalizedStringFilter, PluginFilter, TransformHookFilter, __ΩCallHookOptions, __ΩHookListOrders, __ΩHooksList, __ΩHooksListItem, __ΩInferHookFunction, __ΩInferHookParameters, __ΩInferHookReturnType, __ΩInferHookThisType, __ΩNormalizedStringFilter, __ΩPluginFilter, __ΩTransformHookFilter } from "./types/hooks.cjs";
|
|
5
|
+
import { WorkerProcess, __ΩWorkerProcess } from "./types/utils.cjs";
|
|
6
|
+
import { API, APIFunctions, BaseAPIFunctions, Engine, Execution, ExecutionWorkerParams, ExecutionWorkerProcess, SupportedCommands, __ΩAPI, __ΩAPIFunctions, __ΩBaseAPIFunctions, __ΩEngine, __ΩExecution, __ΩExecutionWorkerParams, __ΩExecutionWorkerProcess, __ΩSupportedCommands } from "./types/api.cjs";
|
|
7
|
+
import { ResolveOptions, StorageAdapter, StoragePort, StoragePreset, VirtualFile, VirtualFileData, VirtualFileExtension, VirtualFileMetadata, VirtualFileSystemInterface, WriteData, WriteOptions, __ΩResolveOptions, __ΩStorageAdapter, __ΩStoragePort, __ΩStoragePreset, __ΩVirtualFile, __ΩVirtualFileData, __ΩVirtualFileExtension, __ΩVirtualFileMetadata, __ΩVirtualFileSystemInterface, __ΩWriteData, __ΩWriteOptions } from "./types/fs.cjs";
|
|
8
8
|
import { CustomLogger, CustomLoggerMessage, LOG_CATEGORIES, LOG_LEVELS, LogCategories, LogCategory, LogFn, LogFnMeta, LogFnOptions, LogLevel, LogLevelResolvedConfig, LogLevelUserConfig, LogLevels, LogMessage, LogMeta, Logger, LoggerMessage, LoggerMeta, LoggerOptions, PowerlinesMessage, __ΩCustomLogger, __ΩCustomLoggerMessage, __ΩLogCategory, __ΩLogFn, __ΩLogFnMeta, __ΩLogFnOptions, __ΩLogLevel, __ΩLogLevelResolvedConfig, __ΩLogLevelUserConfig, __ΩLogMessage, __ΩLogMeta, __ΩLogger, __ΩLoggerMessage, __ΩLoggerMeta, __ΩLoggerOptions, __ΩPowerlinesMessage } from "./types/logging.cjs";
|
|
9
9
|
import { DeepkitOptions, Level, ParsedTypeScriptConfig, RawReflectionMode, ReflectionMode, TSCompilerOptions, TSConfig, __ΩDeepkitOptions, __ΩLevel, __ΩParsedTypeScriptConfig, __ΩRawReflectionMode, __ΩReflectionMode, __ΩTSCompilerOptions, __ΩTSConfig } from "./types/tsconfig.cjs";
|
|
10
10
|
import { BaseContext, BuildPluginContext, Context, EmitEntryOptions, EmitOptions, EngineContext, EnvironmentContext, EnvironmentContextPlugin, ExecutionContext, ExecutionState, ExecutionStateItem, FetchOptions, HookExecutionStateItem, InitContextOptions, MetaInfo, ParseOptions, PluginContext, ResolveResult, Resolver, SelectHookResult, SelectHookResultItem, SelectHooksOptions, SourceFile, TransformResult, UnimportContext, UnresolvedContext, WithUnpluginBuildContext, __ΩBaseContext, __ΩBuildPluginContext, __ΩContext, __ΩEmitEntryOptions, __ΩEmitOptions, __ΩEngineContext, __ΩEnvironmentContext, __ΩEnvironmentContextPlugin, __ΩExecutionContext, __ΩExecutionState, __ΩExecutionStateItem, __ΩFetchOptions, __ΩHookExecutionStateItem, __ΩInitContextOptions, __ΩMetaInfo, __ΩParseOptions, __ΩPluginContext, __ΩResolveResult, __ΩResolver, __ΩSelectHookResult, __ΩSelectHookResultItem, __ΩSelectHooksOptions, __ΩSourceFile, __ΩTransformResult, __ΩUnimportContext, __ΩUnresolvedContext, __ΩWithUnpluginBuildContext } from "./types/context.cjs";
|
|
11
|
-
import { AnyOutputUserConfig, AnyUserConfig, BuildInlineConfig, CleanInlineConfig, Config, CopyConfig,
|
|
11
|
+
import { AnyOutputUserConfig, AnyUserConfig, BuildInlineConfig, CleanInlineConfig, Config, CopyConfig, DeployInlineConfig, DocsInlineConfig, EngineOptions, EnvironmentConfig, EnvironmentResolvedConfig, ExecutionOptions, InferOverridableConfig, InitialPluginConfig, InlineConfig, LintInlineConfig, Mode, NewInlineConfig, Options, OutputConfig, ParsedUserConfig, PartialPlugin, PartialPluginFactory, PluginConfig, PluginConfigObject, PluginConfigTuple, PluginFactory, PowerlinesCommand, PrepareInlineConfig, ProjectType, ResolveConfig, ResolvedAssetGlob, ResolvedConfig, ResolvedCopyConfig, ResolvedEntryTypeDefinition, ResolvedEnvironmentConfig, ResolvedOutputConfig, ResolvedResolveConfig, TestInlineConfig, TypesInlineConfig, UserConfig, UserConfigFn, WorkspaceConfig, __ΩAnyOutputUserConfig, __ΩAnyUserConfig, __ΩBuildInlineConfig, __ΩCleanInlineConfig, __ΩConfig, __ΩCopyConfig, __ΩDeployInlineConfig, __ΩDocsInlineConfig, __ΩEngineOptions, __ΩEnvironmentConfig, __ΩEnvironmentResolvedConfig, __ΩExecutionOptions, __ΩInferOverridableConfig, __ΩInitialPluginConfig, __ΩInlineConfig, __ΩLintInlineConfig, __ΩMode, __ΩNewInlineConfig, __ΩOptions, __ΩOutputConfig, __ΩParsedUserConfig, __ΩPartialPlugin, __ΩPartialPluginFactory, __ΩPluginConfig, __ΩPluginConfigObject, __ΩPluginConfigTuple, __ΩPluginFactory, __ΩPowerlinesCommand, __ΩPrepareInlineConfig, __ΩProjectType, __ΩResolveConfig, __ΩResolvedAssetGlob, __ΩResolvedConfig, __ΩResolvedCopyConfig, __ΩResolvedEntryTypeDefinition, __ΩResolvedEnvironmentConfig, __ΩResolvedOutputConfig, __ΩResolvedResolveConfig, __ΩTestInlineConfig, __ΩTypesInlineConfig, __ΩUserConfig, __ΩUserConfigFn, __ΩWorkspaceConfig } from "./types/config.cjs";
|
|
12
12
|
import { PartiallyResolvedContext, __ΩPartiallyResolvedContext, defineConfig, loadUserConfigFile, loadWorkspaceConfig } from "./lib/config.cjs";
|
|
13
13
|
import { getUniqueInputs, isResolvedEntryTypeDefinition, isTypeDefinition, resolveEntryOutput, resolveInput, resolveInputs, resolveInputsSync } from "./lib/entry.cjs";
|
|
14
14
|
import { combineContexts, isUnpluginBuilderVariant } from "./lib/unplugin/helpers.cjs";
|
|
@@ -19,4 +19,4 @@ import { format, formatFolder } from "./lib/utilities/format.cjs";
|
|
|
19
19
|
import { getMagicString, getSourceFile, getString } from "./lib/utilities/source-file.cjs";
|
|
20
20
|
import { generateSourceMap } from "./lib/utilities/source-map.cjs";
|
|
21
21
|
import { writeFile } from "./lib/utilities/write-file.cjs";
|
|
22
|
-
export { API, APIFunctions, AnyOutputUserConfig, AnyUserConfig, BaseAPIFunctions, BaseCommandType, BaseContext, BasePlugin, BuildInlineConfig, BuildPluginContext, BuilderVariant, CallHookOptions, CleanInlineConfig, CommandType, Commands, Config, Context, CopyConfig,
|
|
22
|
+
export { API, APIFunctions, AnyOutputUserConfig, AnyUserConfig, BaseAPIFunctions, BaseCommandType, BaseContext, BasePlugin, BuildInlineConfig, BuildPluginContext, BuilderVariant, CallHookOptions, CleanInlineConfig, CommandType, Commands, Config, Context, CopyConfig, CreateUnpluginModuleResolutionFunctionsOptions, CreateUnpluginOptions, CreateUnpluginResolverOptions, CustomLogger, CustomLoggerMessage, DeepkitOptions, DeployInlineConfig, DocsInlineConfig, EmitEntryOptions, EmitOptions, Engine, EngineContext, EngineOptions, EnvironmentConfig, EnvironmentContext, EnvironmentContextPlugin, EnvironmentResolvedConfig, Execution, ExecutionContext, ExecutionOptions, ExecutionState, ExecutionStateItem, ExecutionWorkerParams, ExecutionWorkerProcess, FetchOptions, FileHeaderOptions, HookExecutionStateItem, HookFunctions, HookListOrders, Hooks, HooksList, HooksListItem, InferHookFunction, InferHookParameters, InferHookReturnType, InferHookThisType, InferOverridableConfig, InferUnpluginOptions, InferUnpluginVariant, InitContextOptions, InitialPluginConfig, InlineConfig, LOG_CATEGORIES, LOG_LEVELS, Level, LintInlineConfig, LogCategories, LogCategory, LogFn, LogFnMeta, LogFnOptions, LogLevel, LogLevelResolvedConfig, LogLevelUserConfig, LogLevels, LogMessage, LogMeta, Logger, LoggerMessage, LoggerMeta, LoggerOptions, MetaInfo, Mode, NewInlineConfig, NormalizedStringFilter, Options, OutputConfig, ParseOptions, ParsedTypeScriptConfig, ParsedUserConfig, PartialPlugin, PartialPluginFactory, PartiallyResolvedContext, Plugin, PluginConfig, PluginConfigObject, PluginConfigTuple, PluginContext, PluginFactory, PluginFilter, PluginHook, PluginHookFields, PluginHookObject, PluginHooks, PluginNonHookFields, PowerlinesCommand, PowerlinesMessage, PrepareInlineConfig, ProjectType, RawReflectionMode, ReflectionMode, ResolveConfig, ResolveOptions, ResolveResult, ResolvedAssetGlob, ResolvedConfig, ResolvedCopyConfig, ResolvedEntryTypeDefinition, ResolvedEnvironmentConfig, ResolvedOutputConfig, ResolvedResolveConfig, Resolver, SelectHookResult, SelectHookResultItem, SelectHooksOptions, SourceFile, StorageAdapter, StoragePort, StoragePreset, SupportedCommands, TSCompilerOptions, TSConfig, TestInlineConfig, TransformHookFilter, TransformResult, TypesInlineConfig, TypesResult, UnimportContext, UnpluginAsyncFactory, UnpluginBuilderVariant, UnpluginFactory, UnpluginHookFunctions, UnpluginInitialConfig, UnpluginOptions, UnresolvedContext, UserConfig, UserConfigFn, VirtualFile, VirtualFileData, VirtualFileExtension, VirtualFileMetadata, VirtualFileSystemInterface, WithUnpluginBuildContext, WorkerProcess, WorkspaceConfig, WriteData, WriteOptions, __ΩAPI, __ΩAPIFunctions, __ΩAnyOutputUserConfig, __ΩAnyUserConfig, __ΩBaseAPIFunctions, __ΩBaseCommandType, __ΩBaseContext, __ΩBasePlugin, __ΩBuildInlineConfig, __ΩBuildPluginContext, __ΩBuilderVariant, __ΩCallHookOptions, __ΩCleanInlineConfig, __ΩCommandType, __ΩCommands, __ΩConfig, __ΩContext, __ΩCopyConfig, __ΩCreateUnpluginModuleResolutionFunctionsOptions, __ΩCreateUnpluginOptions, __ΩCreateUnpluginResolverOptions, __ΩCustomLogger, __ΩCustomLoggerMessage, __ΩDeepkitOptions, __ΩDeployInlineConfig, __ΩDocsInlineConfig, __ΩEmitEntryOptions, __ΩEmitOptions, __ΩEngine, __ΩEngineContext, __ΩEngineOptions, __ΩEnvironmentConfig, __ΩEnvironmentContext, __ΩEnvironmentContextPlugin, __ΩEnvironmentResolvedConfig, __ΩExecution, __ΩExecutionContext, __ΩExecutionOptions, __ΩExecutionState, __ΩExecutionStateItem, __ΩExecutionWorkerParams, __ΩExecutionWorkerProcess, __ΩFetchOptions, __ΩFileHeaderOptions, __ΩHookExecutionStateItem, __ΩHookFunctions, __ΩHookListOrders, __ΩHooks, __ΩHooksList, __ΩHooksListItem, __ΩInferHookFunction, __ΩInferHookParameters, __ΩInferHookReturnType, __ΩInferHookThisType, __ΩInferOverridableConfig, __ΩInferUnpluginOptions, __ΩInferUnpluginVariant, __ΩInitContextOptions, __ΩInitialPluginConfig, __ΩInlineConfig, __ΩLevel, __ΩLintInlineConfig, __ΩLogCategory, __ΩLogFn, __ΩLogFnMeta, __ΩLogFnOptions, __ΩLogLevel, __ΩLogLevelResolvedConfig, __ΩLogLevelUserConfig, __ΩLogMessage, __ΩLogMeta, __ΩLogger, __ΩLoggerMessage, __ΩLoggerMeta, __ΩLoggerOptions, __ΩMetaInfo, __ΩMode, __ΩNewInlineConfig, __ΩNormalizedStringFilter, __ΩOptions, __ΩOutputConfig, __ΩParseOptions, __ΩParsedTypeScriptConfig, __ΩParsedUserConfig, __ΩPartialPlugin, __ΩPartialPluginFactory, __ΩPartiallyResolvedContext, __ΩPlugin, __ΩPluginConfig, __ΩPluginConfigObject, __ΩPluginConfigTuple, __ΩPluginContext, __ΩPluginFactory, __ΩPluginFilter, __ΩPluginHook, __ΩPluginHookFields, __ΩPluginHookObject, __ΩPluginHooks, __ΩPluginNonHookFields, __ΩPowerlinesCommand, __ΩPowerlinesMessage, __ΩPrepareInlineConfig, __ΩProjectType, __ΩRawReflectionMode, __ΩReflectionMode, __ΩResolveConfig, __ΩResolveOptions, __ΩResolveResult, __ΩResolvedAssetGlob, __ΩResolvedConfig, __ΩResolvedCopyConfig, __ΩResolvedEntryTypeDefinition, __ΩResolvedEnvironmentConfig, __ΩResolvedOutputConfig, __ΩResolvedResolveConfig, __ΩResolver, __ΩSelectHookResult, __ΩSelectHookResultItem, __ΩSelectHooksOptions, __ΩSourceFile, __ΩStorageAdapter, __ΩStoragePort, __ΩStoragePreset, __ΩSupportedCommands, __ΩTSCompilerOptions, __ΩTSConfig, __ΩTestInlineConfig, __ΩTransformHookFilter, __ΩTransformResult, __ΩTypesInlineConfig, __ΩTypesResult, __ΩUnimportContext, __ΩUnpluginAsyncFactory, __ΩUnpluginBuilderVariant, __ΩUnpluginFactory, __ΩUnpluginHookFunctions, __ΩUnpluginInitialConfig, __ΩUnpluginOptions, __ΩUnresolvedContext, __ΩUserConfig, __ΩUserConfigFn, __ΩVirtualFile, __ΩVirtualFileData, __ΩVirtualFileExtension, __ΩVirtualFileMetadata, __ΩVirtualFileSystemInterface, __ΩWithUnpluginBuildContext, __ΩWorkerProcess, __ΩWorkspaceConfig, __ΩWriteData, __ΩWriteOptions, combineContexts, createUnplugin, createUnpluginModuleResolutionFunctions, createUnpluginResolver, defineConfig, format, formatFolder, generateSourceMap, getFileHeader, getFileHeaderWarning, getFileHeaderWarningText, getMagicString, getSourceFile, getString, getTypescriptFileHeader, getUniqueInputs, isResolvedEntryTypeDefinition, isTypeDefinition, isUnpluginBuilderVariant, loadUserConfigFile, loadWorkspaceConfig, resolveEntryOutput, resolveInput, resolveInputs, resolveInputsSync, writeFile };
|
package/dist/index.d.mts
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import { ResolveOptions, StorageAdapter, StoragePort, StoragePreset, VirtualFile, VirtualFileData, VirtualFileExtension, VirtualFileMetadata, VirtualFileSystemInterface, WriteData, WriteOptions, __ΩResolveOptions, __ΩStorageAdapter, __ΩStoragePort, __ΩStoragePreset, __ΩVirtualFile, __ΩVirtualFileData, __ΩVirtualFileExtension, __ΩVirtualFileMetadata, __ΩVirtualFileSystemInterface, __ΩWriteData, __ΩWriteOptions } from "./types/fs.mjs";
|
|
2
1
|
import { BaseCommandType, CommandType, Commands, __ΩBaseCommandType, __ΩCommandType, __ΩCommands } from "./types/commands.mjs";
|
|
3
|
-
import { WorkerProcess, __ΩWorkerProcess } from "./types/utils.mjs";
|
|
4
|
-
import { API, APIFunctions, BaseAPIFunctions, Engine, Execution, ExecutionWorkerParams, ExecutionWorkerProcess, SupportedCommands, __ΩAPI, __ΩAPIFunctions, __ΩBaseAPIFunctions, __ΩEngine, __ΩExecution, __ΩExecutionWorkerParams, __ΩExecutionWorkerProcess, __ΩSupportedCommands } from "./types/api.mjs";
|
|
5
2
|
import { BuilderVariant, InferUnpluginOptions, InferUnpluginVariant, UnpluginAsyncFactory, UnpluginBuilderVariant, UnpluginFactory, UnpluginHookFunctions, UnpluginInitialConfig, UnpluginOptions, __ΩBuilderVariant, __ΩInferUnpluginOptions, __ΩInferUnpluginVariant, __ΩUnpluginAsyncFactory, __ΩUnpluginBuilderVariant, __ΩUnpluginFactory, __ΩUnpluginHookFunctions, __ΩUnpluginInitialConfig, __ΩUnpluginOptions } from "./types/unplugin.mjs";
|
|
6
3
|
import { BasePlugin, HookFunctions, Hooks, Plugin, PluginHook, PluginHookFields, PluginHookObject, PluginHooks, PluginNonHookFields, TypesResult, __ΩBasePlugin, __ΩHookFunctions, __ΩHooks, __ΩPlugin, __ΩPluginHook, __ΩPluginHookFields, __ΩPluginHookObject, __ΩPluginHooks, __ΩPluginNonHookFields, __ΩTypesResult } from "./types/plugin.mjs";
|
|
7
4
|
import { CallHookOptions, HookListOrders, HooksList, HooksListItem, InferHookFunction, InferHookParameters, InferHookReturnType, InferHookThisType, NormalizedStringFilter, PluginFilter, TransformHookFilter, __ΩCallHookOptions, __ΩHookListOrders, __ΩHooksList, __ΩHooksListItem, __ΩInferHookFunction, __ΩInferHookParameters, __ΩInferHookReturnType, __ΩInferHookThisType, __ΩNormalizedStringFilter, __ΩPluginFilter, __ΩTransformHookFilter } from "./types/hooks.mjs";
|
|
5
|
+
import { WorkerProcess, __ΩWorkerProcess } from "./types/utils.mjs";
|
|
6
|
+
import { API, APIFunctions, BaseAPIFunctions, Engine, Execution, ExecutionWorkerParams, ExecutionWorkerProcess, SupportedCommands, __ΩAPI, __ΩAPIFunctions, __ΩBaseAPIFunctions, __ΩEngine, __ΩExecution, __ΩExecutionWorkerParams, __ΩExecutionWorkerProcess, __ΩSupportedCommands } from "./types/api.mjs";
|
|
7
|
+
import { ResolveOptions, StorageAdapter, StoragePort, StoragePreset, VirtualFile, VirtualFileData, VirtualFileExtension, VirtualFileMetadata, VirtualFileSystemInterface, WriteData, WriteOptions, __ΩResolveOptions, __ΩStorageAdapter, __ΩStoragePort, __ΩStoragePreset, __ΩVirtualFile, __ΩVirtualFileData, __ΩVirtualFileExtension, __ΩVirtualFileMetadata, __ΩVirtualFileSystemInterface, __ΩWriteData, __ΩWriteOptions } from "./types/fs.mjs";
|
|
8
8
|
import { CustomLogger, CustomLoggerMessage, LOG_CATEGORIES, LOG_LEVELS, LogCategories, LogCategory, LogFn, LogFnMeta, LogFnOptions, LogLevel, LogLevelResolvedConfig, LogLevelUserConfig, LogLevels, LogMessage, LogMeta, Logger, LoggerMessage, LoggerMeta, LoggerOptions, PowerlinesMessage, __ΩCustomLogger, __ΩCustomLoggerMessage, __ΩLogCategory, __ΩLogFn, __ΩLogFnMeta, __ΩLogFnOptions, __ΩLogLevel, __ΩLogLevelResolvedConfig, __ΩLogLevelUserConfig, __ΩLogMessage, __ΩLogMeta, __ΩLogger, __ΩLoggerMessage, __ΩLoggerMeta, __ΩLoggerOptions, __ΩPowerlinesMessage } from "./types/logging.mjs";
|
|
9
9
|
import { DeepkitOptions, Level, ParsedTypeScriptConfig, RawReflectionMode, ReflectionMode, TSCompilerOptions, TSConfig, __ΩDeepkitOptions, __ΩLevel, __ΩParsedTypeScriptConfig, __ΩRawReflectionMode, __ΩReflectionMode, __ΩTSCompilerOptions, __ΩTSConfig } from "./types/tsconfig.mjs";
|
|
10
10
|
import { BaseContext, BuildPluginContext, Context, EmitEntryOptions, EmitOptions, EngineContext, EnvironmentContext, EnvironmentContextPlugin, ExecutionContext, ExecutionState, ExecutionStateItem, FetchOptions, HookExecutionStateItem, InitContextOptions, MetaInfo, ParseOptions, PluginContext, ResolveResult, Resolver, SelectHookResult, SelectHookResultItem, SelectHooksOptions, SourceFile, TransformResult, UnimportContext, UnresolvedContext, WithUnpluginBuildContext, __ΩBaseContext, __ΩBuildPluginContext, __ΩContext, __ΩEmitEntryOptions, __ΩEmitOptions, __ΩEngineContext, __ΩEnvironmentContext, __ΩEnvironmentContextPlugin, __ΩExecutionContext, __ΩExecutionState, __ΩExecutionStateItem, __ΩFetchOptions, __ΩHookExecutionStateItem, __ΩInitContextOptions, __ΩMetaInfo, __ΩParseOptions, __ΩPluginContext, __ΩResolveResult, __ΩResolver, __ΩSelectHookResult, __ΩSelectHookResultItem, __ΩSelectHooksOptions, __ΩSourceFile, __ΩTransformResult, __ΩUnimportContext, __ΩUnresolvedContext, __ΩWithUnpluginBuildContext } from "./types/context.mjs";
|
|
11
|
-
import { AnyOutputUserConfig, AnyUserConfig, BuildInlineConfig, CleanInlineConfig, Config, CopyConfig,
|
|
11
|
+
import { AnyOutputUserConfig, AnyUserConfig, BuildInlineConfig, CleanInlineConfig, Config, CopyConfig, DeployInlineConfig, DocsInlineConfig, EngineOptions, EnvironmentConfig, EnvironmentResolvedConfig, ExecutionOptions, InferOverridableConfig, InitialPluginConfig, InlineConfig, LintInlineConfig, Mode, NewInlineConfig, Options, OutputConfig, ParsedUserConfig, PartialPlugin, PartialPluginFactory, PluginConfig, PluginConfigObject, PluginConfigTuple, PluginFactory, PowerlinesCommand, PrepareInlineConfig, ProjectType, ResolveConfig, ResolvedAssetGlob, ResolvedConfig, ResolvedCopyConfig, ResolvedEntryTypeDefinition, ResolvedEnvironmentConfig, ResolvedOutputConfig, ResolvedResolveConfig, TestInlineConfig, TypesInlineConfig, UserConfig, UserConfigFn, WorkspaceConfig, __ΩAnyOutputUserConfig, __ΩAnyUserConfig, __ΩBuildInlineConfig, __ΩCleanInlineConfig, __ΩConfig, __ΩCopyConfig, __ΩDeployInlineConfig, __ΩDocsInlineConfig, __ΩEngineOptions, __ΩEnvironmentConfig, __ΩEnvironmentResolvedConfig, __ΩExecutionOptions, __ΩInferOverridableConfig, __ΩInitialPluginConfig, __ΩInlineConfig, __ΩLintInlineConfig, __ΩMode, __ΩNewInlineConfig, __ΩOptions, __ΩOutputConfig, __ΩParsedUserConfig, __ΩPartialPlugin, __ΩPartialPluginFactory, __ΩPluginConfig, __ΩPluginConfigObject, __ΩPluginConfigTuple, __ΩPluginFactory, __ΩPowerlinesCommand, __ΩPrepareInlineConfig, __ΩProjectType, __ΩResolveConfig, __ΩResolvedAssetGlob, __ΩResolvedConfig, __ΩResolvedCopyConfig, __ΩResolvedEntryTypeDefinition, __ΩResolvedEnvironmentConfig, __ΩResolvedOutputConfig, __ΩResolvedResolveConfig, __ΩTestInlineConfig, __ΩTypesInlineConfig, __ΩUserConfig, __ΩUserConfigFn, __ΩWorkspaceConfig } from "./types/config.mjs";
|
|
12
12
|
import { PartiallyResolvedContext, __ΩPartiallyResolvedContext, defineConfig, loadUserConfigFile, loadWorkspaceConfig } from "./lib/config.mjs";
|
|
13
13
|
import { getUniqueInputs, isResolvedEntryTypeDefinition, isTypeDefinition, resolveEntryOutput, resolveInput, resolveInputs, resolveInputsSync } from "./lib/entry.mjs";
|
|
14
14
|
import { combineContexts, isUnpluginBuilderVariant } from "./lib/unplugin/helpers.mjs";
|
|
@@ -19,4 +19,4 @@ import { format, formatFolder } from "./lib/utilities/format.mjs";
|
|
|
19
19
|
import { getMagicString, getSourceFile, getString } from "./lib/utilities/source-file.mjs";
|
|
20
20
|
import { generateSourceMap } from "./lib/utilities/source-map.mjs";
|
|
21
21
|
import { writeFile } from "./lib/utilities/write-file.mjs";
|
|
22
|
-
export { API, APIFunctions, AnyOutputUserConfig, AnyUserConfig, BaseAPIFunctions, BaseCommandType, BaseContext, BasePlugin, BuildInlineConfig, BuildPluginContext, BuilderVariant, CallHookOptions, CleanInlineConfig, CommandType, Commands, Config, Context, CopyConfig,
|
|
22
|
+
export { API, APIFunctions, AnyOutputUserConfig, AnyUserConfig, BaseAPIFunctions, BaseCommandType, BaseContext, BasePlugin, BuildInlineConfig, BuildPluginContext, BuilderVariant, CallHookOptions, CleanInlineConfig, CommandType, Commands, Config, Context, CopyConfig, CreateUnpluginModuleResolutionFunctionsOptions, CreateUnpluginOptions, CreateUnpluginResolverOptions, CustomLogger, CustomLoggerMessage, DeepkitOptions, DeployInlineConfig, DocsInlineConfig, EmitEntryOptions, EmitOptions, Engine, EngineContext, EngineOptions, EnvironmentConfig, EnvironmentContext, EnvironmentContextPlugin, EnvironmentResolvedConfig, Execution, ExecutionContext, ExecutionOptions, ExecutionState, ExecutionStateItem, ExecutionWorkerParams, ExecutionWorkerProcess, FetchOptions, FileHeaderOptions, HookExecutionStateItem, HookFunctions, HookListOrders, Hooks, HooksList, HooksListItem, InferHookFunction, InferHookParameters, InferHookReturnType, InferHookThisType, InferOverridableConfig, InferUnpluginOptions, InferUnpluginVariant, InitContextOptions, InitialPluginConfig, InlineConfig, LOG_CATEGORIES, LOG_LEVELS, Level, LintInlineConfig, LogCategories, LogCategory, LogFn, LogFnMeta, LogFnOptions, LogLevel, LogLevelResolvedConfig, LogLevelUserConfig, LogLevels, LogMessage, LogMeta, Logger, LoggerMessage, LoggerMeta, LoggerOptions, MetaInfo, Mode, NewInlineConfig, NormalizedStringFilter, Options, OutputConfig, ParseOptions, ParsedTypeScriptConfig, ParsedUserConfig, PartialPlugin, PartialPluginFactory, PartiallyResolvedContext, Plugin, PluginConfig, PluginConfigObject, PluginConfigTuple, PluginContext, PluginFactory, PluginFilter, PluginHook, PluginHookFields, PluginHookObject, PluginHooks, PluginNonHookFields, PowerlinesCommand, PowerlinesMessage, PrepareInlineConfig, ProjectType, RawReflectionMode, ReflectionMode, ResolveConfig, ResolveOptions, ResolveResult, ResolvedAssetGlob, ResolvedConfig, ResolvedCopyConfig, ResolvedEntryTypeDefinition, ResolvedEnvironmentConfig, ResolvedOutputConfig, ResolvedResolveConfig, Resolver, SelectHookResult, SelectHookResultItem, SelectHooksOptions, SourceFile, StorageAdapter, StoragePort, StoragePreset, SupportedCommands, TSCompilerOptions, TSConfig, TestInlineConfig, TransformHookFilter, TransformResult, TypesInlineConfig, TypesResult, UnimportContext, UnpluginAsyncFactory, UnpluginBuilderVariant, UnpluginFactory, UnpluginHookFunctions, UnpluginInitialConfig, UnpluginOptions, UnresolvedContext, UserConfig, UserConfigFn, VirtualFile, VirtualFileData, VirtualFileExtension, VirtualFileMetadata, VirtualFileSystemInterface, WithUnpluginBuildContext, WorkerProcess, WorkspaceConfig, WriteData, WriteOptions, __ΩAPI, __ΩAPIFunctions, __ΩAnyOutputUserConfig, __ΩAnyUserConfig, __ΩBaseAPIFunctions, __ΩBaseCommandType, __ΩBaseContext, __ΩBasePlugin, __ΩBuildInlineConfig, __ΩBuildPluginContext, __ΩBuilderVariant, __ΩCallHookOptions, __ΩCleanInlineConfig, __ΩCommandType, __ΩCommands, __ΩConfig, __ΩContext, __ΩCopyConfig, __ΩCreateUnpluginModuleResolutionFunctionsOptions, __ΩCreateUnpluginOptions, __ΩCreateUnpluginResolverOptions, __ΩCustomLogger, __ΩCustomLoggerMessage, __ΩDeepkitOptions, __ΩDeployInlineConfig, __ΩDocsInlineConfig, __ΩEmitEntryOptions, __ΩEmitOptions, __ΩEngine, __ΩEngineContext, __ΩEngineOptions, __ΩEnvironmentConfig, __ΩEnvironmentContext, __ΩEnvironmentContextPlugin, __ΩEnvironmentResolvedConfig, __ΩExecution, __ΩExecutionContext, __ΩExecutionOptions, __ΩExecutionState, __ΩExecutionStateItem, __ΩExecutionWorkerParams, __ΩExecutionWorkerProcess, __ΩFetchOptions, __ΩFileHeaderOptions, __ΩHookExecutionStateItem, __ΩHookFunctions, __ΩHookListOrders, __ΩHooks, __ΩHooksList, __ΩHooksListItem, __ΩInferHookFunction, __ΩInferHookParameters, __ΩInferHookReturnType, __ΩInferHookThisType, __ΩInferOverridableConfig, __ΩInferUnpluginOptions, __ΩInferUnpluginVariant, __ΩInitContextOptions, __ΩInitialPluginConfig, __ΩInlineConfig, __ΩLevel, __ΩLintInlineConfig, __ΩLogCategory, __ΩLogFn, __ΩLogFnMeta, __ΩLogFnOptions, __ΩLogLevel, __ΩLogLevelResolvedConfig, __ΩLogLevelUserConfig, __ΩLogMessage, __ΩLogMeta, __ΩLogger, __ΩLoggerMessage, __ΩLoggerMeta, __ΩLoggerOptions, __ΩMetaInfo, __ΩMode, __ΩNewInlineConfig, __ΩNormalizedStringFilter, __ΩOptions, __ΩOutputConfig, __ΩParseOptions, __ΩParsedTypeScriptConfig, __ΩParsedUserConfig, __ΩPartialPlugin, __ΩPartialPluginFactory, __ΩPartiallyResolvedContext, __ΩPlugin, __ΩPluginConfig, __ΩPluginConfigObject, __ΩPluginConfigTuple, __ΩPluginContext, __ΩPluginFactory, __ΩPluginFilter, __ΩPluginHook, __ΩPluginHookFields, __ΩPluginHookObject, __ΩPluginHooks, __ΩPluginNonHookFields, __ΩPowerlinesCommand, __ΩPowerlinesMessage, __ΩPrepareInlineConfig, __ΩProjectType, __ΩRawReflectionMode, __ΩReflectionMode, __ΩResolveConfig, __ΩResolveOptions, __ΩResolveResult, __ΩResolvedAssetGlob, __ΩResolvedConfig, __ΩResolvedCopyConfig, __ΩResolvedEntryTypeDefinition, __ΩResolvedEnvironmentConfig, __ΩResolvedOutputConfig, __ΩResolvedResolveConfig, __ΩResolver, __ΩSelectHookResult, __ΩSelectHookResultItem, __ΩSelectHooksOptions, __ΩSourceFile, __ΩStorageAdapter, __ΩStoragePort, __ΩStoragePreset, __ΩSupportedCommands, __ΩTSCompilerOptions, __ΩTSConfig, __ΩTestInlineConfig, __ΩTransformHookFilter, __ΩTransformResult, __ΩTypesInlineConfig, __ΩTypesResult, __ΩUnimportContext, __ΩUnpluginAsyncFactory, __ΩUnpluginBuilderVariant, __ΩUnpluginFactory, __ΩUnpluginHookFunctions, __ΩUnpluginInitialConfig, __ΩUnpluginOptions, __ΩUnresolvedContext, __ΩUserConfig, __ΩUserConfigFn, __ΩVirtualFile, __ΩVirtualFileData, __ΩVirtualFileExtension, __ΩVirtualFileMetadata, __ΩVirtualFileSystemInterface, __ΩWithUnpluginBuildContext, __ΩWorkerProcess, __ΩWorkspaceConfig, __ΩWriteData, __ΩWriteOptions, combineContexts, createUnplugin, createUnpluginModuleResolutionFunctions, createUnpluginResolver, defineConfig, format, formatFolder, generateSourceMap, getFileHeader, getFileHeaderWarning, getFileHeaderWarningText, getMagicString, getSourceFile, getString, getTypescriptFileHeader, getUniqueInputs, isResolvedEntryTypeDefinition, isTypeDefinition, isUnpluginBuilderVariant, loadUserConfigFile, loadWorkspaceConfig, resolveEntryOutput, resolveInput, resolveInputs, resolveInputsSync, writeFile };
|
package/dist/lib/config.d.cts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { Context } from "../types/context.cjs";
|
|
2
2
|
import { AnyUserConfig, EngineOptions, ParsedUserConfig, UserConfig, WorkspaceConfig } from "../types/config.cjs";
|
|
3
|
+
import { RequiredKeys } from "@stryke/types/base";
|
|
3
4
|
import { Jiti } from "jiti";
|
|
4
5
|
|
|
5
6
|
//#region src/lib/config.d.ts
|
|
@@ -21,7 +22,7 @@ declare function loadWorkspaceConfig(cwd: string, root: string): Promise<Workspa
|
|
|
21
22
|
* @param jiti - An instance of Jiti to resolve modules from
|
|
22
23
|
* @returns A promise that resolves to the resolved user configuration.
|
|
23
24
|
*/
|
|
24
|
-
declare function loadUserConfigFile(options: EngineOptions, jiti: Jiti): Promise<ParsedUserConfig>;
|
|
25
|
+
declare function loadUserConfigFile(options: RequiredKeys<EngineOptions, "root" | "cwd" | "mode" | "framework">, jiti: Jiti): Promise<ParsedUserConfig>;
|
|
25
26
|
/**
|
|
26
27
|
* A type helper to make it easier to use `powerlines.config.ts` files.
|
|
27
28
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.d.cts","names":[],"sources":["../../src/lib/config.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"config.d.cts","names":[],"sources":["../../src/lib/config.ts"],"mappings":";;;;;;KAuCY,wBAAA,kBAA0C,OAAA,GAAU,OAAA,IAAW,IAAA,CACzE,QAAA,sEAGA,OAAA,CAAQ,QAAA;EACN,MAAA,EAAQ,QAAA;AAAA;;;;;;;;iBAUU,mBAAA,CACpB,GAAA,UACA,IAAA,WACC,OAAA,CAAQ,eAAA;;;;;;;;iBAoBW,kBAAA,CACpB,OAAA,EAAS,YAAA,CAAa,aAAA,0CACtB,IAAA,EAAM,IAAA,GACL,OAAA,CAAQ,gBAAA;;;;;;AA1BX;iBAkMgB,YAAA,CAAa,MAAA,EAAQ,aAAA,GAAgB,UAAA;AAAA"}
|
package/dist/lib/config.d.mts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { Context } from "../types/context.mjs";
|
|
2
2
|
import { AnyUserConfig, EngineOptions, ParsedUserConfig, UserConfig, WorkspaceConfig } from "../types/config.mjs";
|
|
3
|
+
import { RequiredKeys } from "@stryke/types/base";
|
|
3
4
|
import { Jiti } from "jiti";
|
|
4
5
|
|
|
5
6
|
//#region src/lib/config.d.ts
|
|
@@ -21,7 +22,7 @@ declare function loadWorkspaceConfig(cwd: string, root: string): Promise<Workspa
|
|
|
21
22
|
* @param jiti - An instance of Jiti to resolve modules from
|
|
22
23
|
* @returns A promise that resolves to the resolved user configuration.
|
|
23
24
|
*/
|
|
24
|
-
declare function loadUserConfigFile(options: EngineOptions, jiti: Jiti): Promise<ParsedUserConfig>;
|
|
25
|
+
declare function loadUserConfigFile(options: RequiredKeys<EngineOptions, "root" | "cwd" | "mode" | "framework">, jiti: Jiti): Promise<ParsedUserConfig>;
|
|
25
26
|
/**
|
|
26
27
|
* A type helper to make it easier to use `powerlines.config.ts` files.
|
|
27
28
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.d.mts","names":[],"sources":["../../src/lib/config.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"config.d.mts","names":[],"sources":["../../src/lib/config.ts"],"mappings":";;;;;;KAuCY,wBAAA,kBAA0C,OAAA,GAAU,OAAA,IAAW,IAAA,CACzE,QAAA,sEAGA,OAAA,CAAQ,QAAA;EACN,MAAA,EAAQ,QAAA;AAAA;;;;;;;;iBAUU,mBAAA,CACpB,GAAA,UACA,IAAA,WACC,OAAA,CAAQ,eAAA;;;;;;;;iBAoBW,kBAAA,CACpB,OAAA,EAAS,YAAA,CAAa,aAAA,0CACtB,IAAA,EAAM,IAAA,GACL,OAAA,CAAQ,gBAAA;;;;;;AA1BX;iBAkMgB,YAAA,CAAa,MAAA,EAAQ,aAAA,GAAgB,UAAA;AAAA"}
|
package/dist/lib/config.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.mjs","names":["loadConfigC12"],"sources":["../../src/lib/config.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 { getWorkspaceConfig } from \"@storm-software/config-tools/get-config\";\nimport { existsSync } from \"@stryke/fs/exists\";\nimport { appendPath } from \"@stryke/path/append\";\nimport { joinPaths } from \"@stryke/path/join-paths\";\nimport { replacePath } from \"@stryke/path/replace\";\nimport { camelCase } from \"@stryke/string-format/camel-case\";\nimport { isFunction } from \"@stryke/type-checks/is-function\";\nimport { isSetObject } from \"@stryke/type-checks/is-set-object\";\nimport { loadConfig as loadConfigC12 } from \"c12\";\nimport defu from \"defu\";\nimport type { Jiti } from \"jiti\";\nimport type {\n EngineOptions,\n ParsedUserConfig,\n UserConfig,\n WorkspaceConfig\n} from \"../types/config\";\nimport { AnyUserConfig } from \"../types/config\";\nimport { Context } from \"../types/context\";\n\nexport type PartiallyResolvedContext<TContext extends Context = Context> = Omit<\n TContext,\n \"config\" | \"tsconfig\" | \"entry\" | \"fs\" | \"compiler\" | \"unimport\"\n> &\n Partial<TContext> & {\n config: TContext[\"config\"];\n };\n\n/**\n * Loads the workspace configuration.\n *\n * @param cwd - The root directory of the workspace.\n * @param root - The current working directory to start searching from.\n * @returns A promise that resolves to the loaded workspace configuration.\n */\nexport async function loadWorkspaceConfig(\n cwd: string,\n root: string\n): Promise<WorkspaceConfig> {\n return defu(\n {\n workspaceRoot: cwd\n },\n await getWorkspaceConfig(true, {\n cwd: root,\n workspaceRoot: cwd,\n useDefault: true\n })\n );\n}\n\n/**\n * Loads the user configuration file for the project.\n *\n * @param options - The engine options containing the root, cwd, mode, framework, and organization.\n * @param jiti - An instance of Jiti to resolve modules from\n * @returns A promise that resolves to the resolved user configuration.\n */\nexport async function loadUserConfigFile(\n options: EngineOptions,\n jiti: Jiti\n): Promise<ParsedUserConfig> {\n let resolvedUserConfig: Partial<ParsedUserConfig> = {};\n\n let resolvedUserConfigFile: string | undefined;\n if (options.configFile) {\n resolvedUserConfigFile = existsSync(\n replacePath(options.configFile, options.root)\n )\n ? replacePath(options.configFile, options.root)\n : existsSync(\n joinPaths(\n appendPath(options.root, options.cwd),\n replacePath(options.configFile, options.root)\n )\n )\n ? joinPaths(\n appendPath(options.root, options.cwd),\n replacePath(options.configFile, options.root)\n )\n : existsSync(\n joinPaths(\n appendPath(options.root, options.cwd),\n options.configFile\n )\n )\n ? joinPaths(appendPath(options.root, options.cwd), options.configFile)\n : undefined;\n }\n\n if (!resolvedUserConfigFile) {\n resolvedUserConfigFile = existsSync(\n joinPaths(\n appendPath(options.root, options.cwd),\n `${options.framework}.${options.mode}.config.ts`\n )\n )\n ? joinPaths(\n appendPath(options.root, options.cwd),\n `${options.framework}.${options.mode}.config.ts`\n )\n : existsSync(\n joinPaths(\n appendPath(options.root, options.cwd),\n `${options.framework}.${options.mode}.config.js`\n )\n )\n ? joinPaths(\n appendPath(options.root, options.cwd),\n `${options.framework}.${options.mode}.config.js`\n )\n : existsSync(\n joinPaths(\n appendPath(options.root, options.cwd),\n `${options.framework}.${options.mode}.config.mts`\n )\n )\n ? joinPaths(\n appendPath(options.root, options.cwd),\n `${options.framework}.${options.mode}.config.mts`\n )\n : existsSync(\n joinPaths(\n appendPath(options.root, options.cwd),\n `${options.framework}.${options.mode}.config.mjs`\n )\n )\n ? joinPaths(\n appendPath(options.root, options.cwd),\n `${options.framework}.${options.mode}.config.mjs`\n )\n : existsSync(\n joinPaths(\n appendPath(options.root, options.cwd),\n `${options.framework}.config.ts`\n )\n )\n ? joinPaths(\n appendPath(options.root, options.cwd),\n `${options.framework}.config.ts`\n )\n : existsSync(\n joinPaths(\n appendPath(options.root, options.cwd),\n `${options.framework}.config.js`\n )\n )\n ? joinPaths(\n appendPath(options.root, options.cwd),\n `${options.framework}.config.js`\n )\n : existsSync(\n joinPaths(\n appendPath(options.root, options.cwd),\n `${options.framework}.config.mts`\n )\n )\n ? joinPaths(\n appendPath(options.root, options.cwd),\n `${options.framework}.config.mts`\n )\n : existsSync(\n joinPaths(\n appendPath(options.root, options.cwd),\n `${options.framework}.config.mjs`\n )\n )\n ? joinPaths(\n appendPath(options.root, options.cwd),\n `${options.framework}.config.mjs`\n )\n : undefined;\n }\n\n if (resolvedUserConfigFile) {\n const resolved = await jiti.import<{ default: AnyUserConfig }>(\n jiti.esmResolve(resolvedUserConfigFile)\n );\n if (resolved?.default) {\n let config = {};\n if (isFunction(resolved.default)) {\n config = await Promise.resolve(resolved.default(options));\n } else if (\n isSetObject(resolved.default) ||\n Array.isArray(resolved.default)\n ) {\n config = resolved.default;\n }\n\n if (isSetObject(config) || Array.isArray(config)) {\n resolvedUserConfig = {\n ...config,\n config,\n configFile: resolvedUserConfigFile\n };\n }\n }\n }\n\n const result = await loadConfigC12({\n cwd: options.root,\n name: options.framework,\n envName: options.mode,\n globalRc: true,\n packageJson: camelCase(options.framework),\n dotenv: true,\n jiti\n });\n\n return defu(\n {\n config: {\n root: options.root,\n cwd: options.cwd,\n framework: options.framework,\n organization: options.organization\n }\n },\n resolvedUserConfig,\n isSetObject(result?.config) ? { ...result.config, ...result } : {}\n );\n}\n\n/**\n * A type helper to make it easier to use `powerlines.config.ts` files.\n *\n * @remarks\n * The function accepts a direct {@link AnyUserConfig} object/function and returns it typed as a {@link UserConfig} object.\n */\nexport function defineConfig(config: AnyUserConfig): UserConfig {\n return config as any;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAqDA,eAAsB,oBACpB,KACA,MAC0B;AAC1B,QAAO,KACL,EACE,eAAe,KAChB,EACD,MAAM,mBAAmB,MAAM;EAC7B,KAAK;EACL,eAAe;EACf,YAAY;EACb,CAAC,CACH;;;;;;;;;AAUH,eAAsB,mBACpB,SACA,MAC2B;CAC3B,IAAI,qBAAgD,EAAE;CAEtD,IAAI;AACJ,KAAI,QAAQ,WACV,0BAAyB,WACvB,YAAY,QAAQ,YAAY,QAAQ,KAAK,CAC9C,GACG,YAAY,QAAQ,YAAY,QAAQ,KAAK,GAC7C,WACI,UACE,WAAW,QAAQ,MAAM,QAAQ,IAAI,EACrC,YAAY,QAAQ,YAAY,QAAQ,KAAK,CAC9C,CACF,GACD,UACE,WAAW,QAAQ,MAAM,QAAQ,IAAI,EACrC,YAAY,QAAQ,YAAY,QAAQ,KAAK,CAC9C,GACD,WACI,UACE,WAAW,QAAQ,MAAM,QAAQ,IAAI,EACrC,QAAQ,WACT,CACF,GACD,UAAU,WAAW,QAAQ,MAAM,QAAQ,IAAI,EAAE,QAAQ,WAAW,GACpE;AAGV,KAAI,CAAC,uBACH,0BAAyB,WACvB,UACE,WAAW,QAAQ,MAAM,QAAQ,IAAI,EACrC,GAAG,QAAQ,UAAU,GAAG,QAAQ,KAAK,YACtC,CACF,GACG,UACE,WAAW,QAAQ,MAAM,QAAQ,IAAI,EACrC,GAAG,QAAQ,UAAU,GAAG,QAAQ,KAAK,YACtC,GACD,WACI,UACE,WAAW,QAAQ,MAAM,QAAQ,IAAI,EACrC,GAAG,QAAQ,UAAU,GAAG,QAAQ,KAAK,YACtC,CACF,GACD,UACE,WAAW,QAAQ,MAAM,QAAQ,IAAI,EACrC,GAAG,QAAQ,UAAU,GAAG,QAAQ,KAAK,YACtC,GACD,WACI,UACE,WAAW,QAAQ,MAAM,QAAQ,IAAI,EACrC,GAAG,QAAQ,UAAU,GAAG,QAAQ,KAAK,aACtC,CACF,GACD,UACE,WAAW,QAAQ,MAAM,QAAQ,IAAI,EACrC,GAAG,QAAQ,UAAU,GAAG,QAAQ,KAAK,aACtC,GACD,WACI,UACE,WAAW,QAAQ,MAAM,QAAQ,IAAI,EACrC,GAAG,QAAQ,UAAU,GAAG,QAAQ,KAAK,aACtC,CACF,GACD,UACE,WAAW,QAAQ,MAAM,QAAQ,IAAI,EACrC,GAAG,QAAQ,UAAU,GAAG,QAAQ,KAAK,aACtC,GACD,WACI,UACE,WAAW,QAAQ,MAAM,QAAQ,IAAI,EACrC,GAAG,QAAQ,UAAU,YACtB,CACF,GACD,UACE,WAAW,QAAQ,MAAM,QAAQ,IAAI,EACrC,GAAG,QAAQ,UAAU,YACtB,GACD,WACI,UACE,WAAW,QAAQ,MAAM,QAAQ,IAAI,EACrC,GAAG,QAAQ,UAAU,YACtB,CACF,GACD,UACE,WAAW,QAAQ,MAAM,QAAQ,IAAI,EACrC,GAAG,QAAQ,UAAU,YACtB,GACD,WACI,UACE,WAAW,QAAQ,MAAM,QAAQ,IAAI,EACrC,GAAG,QAAQ,UAAU,aACtB,CACF,GACD,UACE,WAAW,QAAQ,MAAM,QAAQ,IAAI,EACrC,GAAG,QAAQ,UAAU,aACtB,GACD,WACI,UACE,WAAW,QAAQ,MAAM,QAAQ,IAAI,EACrC,GAAG,QAAQ,UAAU,aACtB,CACF,GACD,UACE,WAAW,QAAQ,MAAM,QAAQ,IAAI,EACrC,GAAG,QAAQ,UAAU,aACtB,GACD;AAGpB,KAAI,wBAAwB;EAC1B,MAAM,WAAW,MAAM,KAAK,OAC1B,KAAK,WAAW,uBAAuB,CACxC;AACD,MAAI,UAAU,SAAS;GACrB,IAAI,SAAS,EAAE;AACf,OAAI,WAAW,SAAS,QAAQ,CAC9B,UAAS,MAAM,QAAQ,QAAQ,SAAS,QAAQ,QAAQ,CAAC;YAEzD,YAAY,SAAS,QAAQ,IAC7B,MAAM,QAAQ,SAAS,QAAQ,CAE/B,UAAS,SAAS;AAGpB,OAAI,YAAY,OAAO,IAAI,MAAM,QAAQ,OAAO,CAC9C,sBAAqB;IACnB,GAAG;IACH;IACA,YAAY;IACb;;;CAKP,MAAM,SAAS,MAAMA,WAAc;EACjC,KAAK,QAAQ;EACb,MAAM,QAAQ;EACd,SAAS,QAAQ;EACjB,UAAU;EACV,aAAa,UAAU,QAAQ,UAAU;EACzC,QAAQ;EACR;EACD,CAAC;AAEF,QAAO,KACL,EACE,QAAQ;EACN,MAAM,QAAQ;EACd,KAAK,QAAQ;EACb,WAAW,QAAQ;EACnB,cAAc,QAAQ;EACvB,EACF,EACD,oBACA,YAAY,QAAQ,OAAO,GAAG;EAAE,GAAG,OAAO;EAAQ,GAAG;EAAQ,GAAG,EAAE,CACnE;;;;;;;;AASH,SAAgB,aAAa,QAAmC;AAC9D,QAAO"}
|
|
1
|
+
{"version":3,"file":"config.mjs","names":["loadConfigC12"],"sources":["../../src/lib/config.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 { getWorkspaceConfig } from \"@storm-software/config-tools/get-config\";\nimport { existsSync } from \"@stryke/fs/exists\";\nimport { appendPath } from \"@stryke/path/append\";\nimport { joinPaths } from \"@stryke/path/join-paths\";\nimport { replacePath } from \"@stryke/path/replace\";\nimport { camelCase } from \"@stryke/string-format/camel-case\";\nimport { isFunction } from \"@stryke/type-checks/is-function\";\nimport { isSetObject } from \"@stryke/type-checks/is-set-object\";\nimport { RequiredKeys } from \"@stryke/types/base\";\nimport { loadConfig as loadConfigC12 } from \"c12\";\nimport defu from \"defu\";\nimport type { Jiti } from \"jiti\";\nimport type {\n EngineOptions,\n ParsedUserConfig,\n UserConfig,\n WorkspaceConfig\n} from \"../types/config\";\nimport { AnyUserConfig } from \"../types/config\";\nimport { Context } from \"../types/context\";\n\nexport type PartiallyResolvedContext<TContext extends Context = Context> = Omit<\n TContext,\n \"config\" | \"tsconfig\" | \"entry\" | \"fs\" | \"compiler\" | \"unimport\"\n> &\n Partial<TContext> & {\n config: TContext[\"config\"];\n };\n\n/**\n * Loads the workspace configuration.\n *\n * @param cwd - The root directory of the workspace.\n * @param root - The current working directory to start searching from.\n * @returns A promise that resolves to the loaded workspace configuration.\n */\nexport async function loadWorkspaceConfig(\n cwd: string,\n root: string\n): Promise<WorkspaceConfig> {\n return defu(\n {\n workspaceRoot: cwd\n },\n await getWorkspaceConfig(true, {\n cwd: root,\n workspaceRoot: cwd,\n useDefault: true\n })\n );\n}\n\n/**\n * Loads the user configuration file for the project.\n *\n * @param options - The engine options containing the root, cwd, mode, framework, and organization.\n * @param jiti - An instance of Jiti to resolve modules from\n * @returns A promise that resolves to the resolved user configuration.\n */\nexport async function loadUserConfigFile(\n options: RequiredKeys<EngineOptions, \"root\" | \"cwd\" | \"mode\" | \"framework\">,\n jiti: Jiti\n): Promise<ParsedUserConfig> {\n let resolvedUserConfig: Partial<ParsedUserConfig> = {};\n\n let resolvedUserConfigFile: string | undefined;\n if (options.configFile) {\n resolvedUserConfigFile = existsSync(\n replacePath(options.configFile, options.root)\n )\n ? replacePath(options.configFile, options.root)\n : existsSync(\n joinPaths(\n appendPath(options.root, options.cwd),\n replacePath(options.configFile, options.root)\n )\n )\n ? joinPaths(\n appendPath(options.root, options.cwd),\n replacePath(options.configFile, options.root)\n )\n : existsSync(\n joinPaths(\n appendPath(options.root, options.cwd),\n options.configFile\n )\n )\n ? joinPaths(appendPath(options.root, options.cwd), options.configFile)\n : undefined;\n }\n\n if (!resolvedUserConfigFile) {\n resolvedUserConfigFile = existsSync(\n joinPaths(\n appendPath(options.root, options.cwd),\n `${options.framework}.${options.mode}.config.ts`\n )\n )\n ? joinPaths(\n appendPath(options.root, options.cwd),\n `${options.framework}.${options.mode}.config.ts`\n )\n : existsSync(\n joinPaths(\n appendPath(options.root, options.cwd),\n `${options.framework}.${options.mode}.config.js`\n )\n )\n ? joinPaths(\n appendPath(options.root, options.cwd),\n `${options.framework}.${options.mode}.config.js`\n )\n : existsSync(\n joinPaths(\n appendPath(options.root, options.cwd),\n `${options.framework}.${options.mode}.config.mts`\n )\n )\n ? joinPaths(\n appendPath(options.root, options.cwd),\n `${options.framework}.${options.mode}.config.mts`\n )\n : existsSync(\n joinPaths(\n appendPath(options.root, options.cwd),\n `${options.framework}.${options.mode}.config.mjs`\n )\n )\n ? joinPaths(\n appendPath(options.root, options.cwd),\n `${options.framework}.${options.mode}.config.mjs`\n )\n : existsSync(\n joinPaths(\n appendPath(options.root, options.cwd),\n `${options.framework}.config.ts`\n )\n )\n ? joinPaths(\n appendPath(options.root, options.cwd),\n `${options.framework}.config.ts`\n )\n : existsSync(\n joinPaths(\n appendPath(options.root, options.cwd),\n `${options.framework}.config.js`\n )\n )\n ? joinPaths(\n appendPath(options.root, options.cwd),\n `${options.framework}.config.js`\n )\n : existsSync(\n joinPaths(\n appendPath(options.root, options.cwd),\n `${options.framework}.config.mts`\n )\n )\n ? joinPaths(\n appendPath(options.root, options.cwd),\n `${options.framework}.config.mts`\n )\n : existsSync(\n joinPaths(\n appendPath(options.root, options.cwd),\n `${options.framework}.config.mjs`\n )\n )\n ? joinPaths(\n appendPath(options.root, options.cwd),\n `${options.framework}.config.mjs`\n )\n : undefined;\n }\n\n if (resolvedUserConfigFile) {\n const resolved = await jiti.import<{ default: AnyUserConfig }>(\n jiti.esmResolve(resolvedUserConfigFile)\n );\n if (resolved?.default) {\n let config = {};\n if (isFunction(resolved.default)) {\n config = await Promise.resolve(resolved.default(options));\n } else if (\n isSetObject(resolved.default) ||\n Array.isArray(resolved.default)\n ) {\n config = resolved.default;\n }\n\n if (isSetObject(config) || Array.isArray(config)) {\n resolvedUserConfig = {\n ...config,\n config,\n configFile: resolvedUserConfigFile\n };\n }\n }\n }\n\n const result = await loadConfigC12({\n cwd: options.root,\n name: options.framework,\n envName: options.mode,\n globalRc: true,\n packageJson: camelCase(options.framework),\n dotenv: true,\n jiti\n });\n\n return defu(\n {\n config: {\n root: options.root,\n cwd: options.cwd,\n framework: options.framework,\n organization: options.organization\n }\n },\n resolvedUserConfig,\n isSetObject(result?.config) ? { ...result.config, ...result } : {}\n );\n}\n\n/**\n * A type helper to make it easier to use `powerlines.config.ts` files.\n *\n * @remarks\n * The function accepts a direct {@link AnyUserConfig} object/function and returns it typed as a {@link UserConfig} object.\n */\nexport function defineConfig(config: AnyUserConfig): UserConfig {\n return config as any;\n}\n"],"mappings":"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"}
|
|
@@ -27,7 +27,7 @@ function createUnpluginModuleResolutionFunctions(context, options = {}) {
|
|
|
27
27
|
async resolveId(id, importer, opts = { isEntry: false }) {
|
|
28
28
|
const normalizedId = id.replace(require_constants_virtual_modules.VIRTUAL_MODULE_PREFIX_REGEX, "");
|
|
29
29
|
const normalizedImporter = importer ? importer.replace(require_constants_virtual_modules.VIRTUAL_MODULE_PREFIX_REGEX, "") : void 0;
|
|
30
|
-
let result = await ctx
|
|
30
|
+
let result = await ctx.api.callHook("resolveId", {
|
|
31
31
|
sequential: true,
|
|
32
32
|
result: "first",
|
|
33
33
|
order: "pre"
|
|
@@ -35,9 +35,9 @@ function createUnpluginModuleResolutionFunctions(context, options = {}) {
|
|
|
35
35
|
if ((0, _stryke_type_checks_is_set_string.isSetString)(result)) return result;
|
|
36
36
|
else if ((0, _stryke_type_checks_is_set_object.isSetObject)(result)) return {
|
|
37
37
|
...result,
|
|
38
|
-
id: result.virtual && options.prefix !== false ? `${
|
|
38
|
+
id: result.virtual && options.prefix !== false ? `${"\0"}${result.id}` : result.id
|
|
39
39
|
};
|
|
40
|
-
result = await ctx
|
|
40
|
+
result = await ctx.api.callHook("resolveId", {
|
|
41
41
|
sequential: true,
|
|
42
42
|
result: "first",
|
|
43
43
|
order: "normal"
|
|
@@ -45,7 +45,7 @@ function createUnpluginModuleResolutionFunctions(context, options = {}) {
|
|
|
45
45
|
if ((0, _stryke_type_checks_is_set_string.isSetString)(result)) return result;
|
|
46
46
|
else if ((0, _stryke_type_checks_is_set_object.isSetObject)(result)) return {
|
|
47
47
|
...result,
|
|
48
|
-
id: result.virtual && options.prefix !== false ? `${
|
|
48
|
+
id: result.virtual && options.prefix !== false ? `${"\0"}${result.id}` : result.id
|
|
49
49
|
};
|
|
50
50
|
result = await ctx.resolve(normalizedId, normalizedImporter, (0, defu.default)(options.overrides ?? {}, {
|
|
51
51
|
isFile: true,
|
|
@@ -53,9 +53,9 @@ function createUnpluginModuleResolutionFunctions(context, options = {}) {
|
|
|
53
53
|
}));
|
|
54
54
|
if ((0, _stryke_type_checks_is_set_object.isSetObject)(result)) return {
|
|
55
55
|
...result,
|
|
56
|
-
id: result.virtual && options.prefix !== false ? `${
|
|
56
|
+
id: result.virtual && options.prefix !== false ? `${"\0"}${result.id}` : result.id
|
|
57
57
|
};
|
|
58
|
-
result = await ctx
|
|
58
|
+
result = await ctx.api.callHook("resolveId", {
|
|
59
59
|
sequential: true,
|
|
60
60
|
result: "first",
|
|
61
61
|
order: "post"
|
|
@@ -63,7 +63,7 @@ function createUnpluginModuleResolutionFunctions(context, options = {}) {
|
|
|
63
63
|
if ((0, _stryke_type_checks_is_set_string.isSetString)(result)) return result;
|
|
64
64
|
else if ((0, _stryke_type_checks_is_set_object.isSetObject)(result)) return {
|
|
65
65
|
...result,
|
|
66
|
-
id: result.virtual && options.prefix !== false ? `${
|
|
66
|
+
id: result.virtual && options.prefix !== false ? `${"\0"}${result.id}` : result.id
|
|
67
67
|
};
|
|
68
68
|
return null;
|
|
69
69
|
},
|
|
@@ -71,13 +71,13 @@ function createUnpluginModuleResolutionFunctions(context, options = {}) {
|
|
|
71
71
|
filter: options.prefix !== false ? { id: { include: [require_constants_virtual_modules.VIRTUAL_MODULE_PREFIX_REGEX] } } : void 0,
|
|
72
72
|
async handler(id) {
|
|
73
73
|
const normalizedId = id.replace(require_constants_virtual_modules.VIRTUAL_MODULE_PREFIX_REGEX, "");
|
|
74
|
-
let result = await ctx
|
|
74
|
+
let result = await ctx.api.callHook("load", {
|
|
75
75
|
sequential: true,
|
|
76
76
|
result: "first",
|
|
77
77
|
order: "pre"
|
|
78
78
|
}, normalizedId);
|
|
79
79
|
if (result) return result;
|
|
80
|
-
result = await ctx
|
|
80
|
+
result = await ctx.api.callHook("load", {
|
|
81
81
|
sequential: true,
|
|
82
82
|
result: "first",
|
|
83
83
|
order: "normal"
|
|
@@ -85,7 +85,7 @@ function createUnpluginModuleResolutionFunctions(context, options = {}) {
|
|
|
85
85
|
if (result) return result;
|
|
86
86
|
result = await ctx.load(normalizedId);
|
|
87
87
|
if (result) return result;
|
|
88
|
-
return ctx
|
|
88
|
+
return ctx.api.callHook("load", {
|
|
89
89
|
sequential: true,
|
|
90
90
|
result: "first",
|
|
91
91
|
order: "post"
|
|
@@ -24,7 +24,7 @@ function createUnpluginModuleResolutionFunctions(context, options = {}) {
|
|
|
24
24
|
async resolveId(id, importer, opts = { isEntry: false }) {
|
|
25
25
|
const normalizedId = id.replace(VIRTUAL_MODULE_PREFIX_REGEX, "");
|
|
26
26
|
const normalizedImporter = importer ? importer.replace(VIRTUAL_MODULE_PREFIX_REGEX, "") : void 0;
|
|
27
|
-
let result = await ctx
|
|
27
|
+
let result = await ctx.api.callHook("resolveId", {
|
|
28
28
|
sequential: true,
|
|
29
29
|
result: "first",
|
|
30
30
|
order: "pre"
|
|
@@ -32,9 +32,9 @@ function createUnpluginModuleResolutionFunctions(context, options = {}) {
|
|
|
32
32
|
if (isSetString(result)) return result;
|
|
33
33
|
else if (isSetObject(result)) return {
|
|
34
34
|
...result,
|
|
35
|
-
id: result.virtual && options.prefix !== false ? `${
|
|
35
|
+
id: result.virtual && options.prefix !== false ? `${"\0"}${result.id}` : result.id
|
|
36
36
|
};
|
|
37
|
-
result = await ctx
|
|
37
|
+
result = await ctx.api.callHook("resolveId", {
|
|
38
38
|
sequential: true,
|
|
39
39
|
result: "first",
|
|
40
40
|
order: "normal"
|
|
@@ -42,7 +42,7 @@ function createUnpluginModuleResolutionFunctions(context, options = {}) {
|
|
|
42
42
|
if (isSetString(result)) return result;
|
|
43
43
|
else if (isSetObject(result)) return {
|
|
44
44
|
...result,
|
|
45
|
-
id: result.virtual && options.prefix !== false ? `${
|
|
45
|
+
id: result.virtual && options.prefix !== false ? `${"\0"}${result.id}` : result.id
|
|
46
46
|
};
|
|
47
47
|
result = await ctx.resolve(normalizedId, normalizedImporter, defu(options.overrides ?? {}, {
|
|
48
48
|
isFile: true,
|
|
@@ -50,9 +50,9 @@ function createUnpluginModuleResolutionFunctions(context, options = {}) {
|
|
|
50
50
|
}));
|
|
51
51
|
if (isSetObject(result)) return {
|
|
52
52
|
...result,
|
|
53
|
-
id: result.virtual && options.prefix !== false ? `${
|
|
53
|
+
id: result.virtual && options.prefix !== false ? `${"\0"}${result.id}` : result.id
|
|
54
54
|
};
|
|
55
|
-
result = await ctx
|
|
55
|
+
result = await ctx.api.callHook("resolveId", {
|
|
56
56
|
sequential: true,
|
|
57
57
|
result: "first",
|
|
58
58
|
order: "post"
|
|
@@ -60,7 +60,7 @@ function createUnpluginModuleResolutionFunctions(context, options = {}) {
|
|
|
60
60
|
if (isSetString(result)) return result;
|
|
61
61
|
else if (isSetObject(result)) return {
|
|
62
62
|
...result,
|
|
63
|
-
id: result.virtual && options.prefix !== false ? `${
|
|
63
|
+
id: result.virtual && options.prefix !== false ? `${"\0"}${result.id}` : result.id
|
|
64
64
|
};
|
|
65
65
|
return null;
|
|
66
66
|
},
|
|
@@ -68,13 +68,13 @@ function createUnpluginModuleResolutionFunctions(context, options = {}) {
|
|
|
68
68
|
filter: options.prefix !== false ? { id: { include: [VIRTUAL_MODULE_PREFIX_REGEX] } } : void 0,
|
|
69
69
|
async handler(id) {
|
|
70
70
|
const normalizedId = id.replace(VIRTUAL_MODULE_PREFIX_REGEX, "");
|
|
71
|
-
let result = await ctx
|
|
71
|
+
let result = await ctx.api.callHook("load", {
|
|
72
72
|
sequential: true,
|
|
73
73
|
result: "first",
|
|
74
74
|
order: "pre"
|
|
75
75
|
}, normalizedId);
|
|
76
76
|
if (result) return result;
|
|
77
|
-
result = await ctx
|
|
77
|
+
result = await ctx.api.callHook("load", {
|
|
78
78
|
sequential: true,
|
|
79
79
|
result: "first",
|
|
80
80
|
order: "normal"
|
|
@@ -82,7 +82,7 @@ function createUnpluginModuleResolutionFunctions(context, options = {}) {
|
|
|
82
82
|
if (result) return result;
|
|
83
83
|
result = await ctx.load(normalizedId);
|
|
84
84
|
if (result) return result;
|
|
85
|
-
return ctx
|
|
85
|
+
return ctx.api.callHook("load", {
|
|
86
86
|
sequential: true,
|
|
87
87
|
result: "first",
|
|
88
88
|
order: "post"
|
|
@@ -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 VIRTUAL_MODULE_PREFIX,\n VIRTUAL_MODULE_PREFIX_REGEX\n} from \"../../constants\";\nimport { Unstable_PluginContext } from \"../../types/_internal\";\nimport { PluginContext, ResolveResult } from \"../../types/context\";\nimport { ResolveOptions } from \"../../types/fs\";\n\nexport interface CreateUnpluginModuleResolutionFunctionsOptions {\n /**\n * An indicator of whether to prefix virtual module IDs with a specific string. This is useful for ensuring that virtual modules are only processed by the plugin and not by other plugins or the bundler itself.\n *\n * @remarks\n * - If set to `true`, virtual module IDs will be prefixed with the string `__powerlines-virtual:`.\n * - If set to `false`, no prefix will be added to virtual module IDs.\n *\n * @defaultValue true\n */\n prefix?: boolean;\n\n /**\n * Optional overrides for the module resolution configuration.\n *\n * @remarks\n * This allows you to customize the behavior of the module resolution hooks by providing specific configuration options.\n */\n overrides?: Partial<ResolveOptions>;\n}\n\n/**\n * Creates the module resolution hook functions for a Powerlines unplugin plugin instance.\n *\n * @remarks\n * This includes the `resolveId` and `load` hooks.\n *\n * @see https://rollupjs.org/plugin-development/#resolveid\n * @see https://rollupjs.org/plugin-development/#load\n *\n * @param context - The plugin context.\n * @param options - Options for creating the module resolution functions.\n * @returns The module resolution hooks (`resolveId` and `load`).\n */\nexport function createUnpluginModuleResolutionFunctions<\n TContext extends PluginContext = PluginContext\n>(\n context: TContext,\n options: CreateUnpluginModuleResolutionFunctionsOptions = {}\n): Pick<UnpluginOptions, \"resolveId\" | \"load\"> {\n const ctx = context as unknown as Unstable_PluginContext;\n\n return {\n async resolveId(\n this: UnpluginBuildContext & UnpluginContext,\n id: string,\n importer?: string,\n opts: {\n isEntry: boolean;\n } = { isEntry: false }\n ): Promise<string | ResolveResult | null | undefined> {\n const normalizedId = id.replace(VIRTUAL_MODULE_PREFIX_REGEX, \"\");\n const normalizedImporter = importer\n ? importer.replace(VIRTUAL_MODULE_PREFIX_REGEX, \"\")\n : undefined;\n\n let result = await ctx
|
|
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 VIRTUAL_MODULE_PREFIX,\n VIRTUAL_MODULE_PREFIX_REGEX\n} from \"../../constants\";\nimport { Unstable_PluginContext } from \"../../types/_internal\";\nimport { PluginContext, ResolveResult } from \"../../types/context\";\nimport { ResolveOptions } from \"../../types/fs\";\n\nexport interface CreateUnpluginModuleResolutionFunctionsOptions {\n /**\n * An indicator of whether to prefix virtual module IDs with a specific string. This is useful for ensuring that virtual modules are only processed by the plugin and not by other plugins or the bundler itself.\n *\n * @remarks\n * - If set to `true`, virtual module IDs will be prefixed with the string `__powerlines-virtual:`.\n * - If set to `false`, no prefix will be added to virtual module IDs.\n *\n * @defaultValue true\n */\n prefix?: boolean;\n\n /**\n * Optional overrides for the module resolution configuration.\n *\n * @remarks\n * This allows you to customize the behavior of the module resolution hooks by providing specific configuration options.\n */\n overrides?: Partial<ResolveOptions>;\n}\n\n/**\n * Creates the module resolution hook functions for a Powerlines unplugin plugin instance.\n *\n * @remarks\n * This includes the `resolveId` and `load` hooks.\n *\n * @see https://rollupjs.org/plugin-development/#resolveid\n * @see https://rollupjs.org/plugin-development/#load\n *\n * @param context - The plugin context.\n * @param options - Options for creating the module resolution functions.\n * @returns The module resolution hooks (`resolveId` and `load`).\n */\nexport function createUnpluginModuleResolutionFunctions<\n TContext extends PluginContext = PluginContext\n>(\n context: TContext,\n options: CreateUnpluginModuleResolutionFunctionsOptions = {}\n): Pick<UnpluginOptions, \"resolveId\" | \"load\"> {\n const ctx = context as unknown as Unstable_PluginContext;\n\n return {\n async resolveId(\n this: UnpluginBuildContext & UnpluginContext,\n id: string,\n importer?: string,\n opts: {\n isEntry: boolean;\n } = { isEntry: false }\n ): Promise<string | ResolveResult | null | undefined> {\n const normalizedId = id.replace(VIRTUAL_MODULE_PREFIX_REGEX, \"\");\n const normalizedImporter = importer\n ? importer.replace(VIRTUAL_MODULE_PREFIX_REGEX, \"\")\n : undefined;\n\n let result = await ctx.api.callHook(\n \"resolveId\",\n {\n sequential: true,\n result: \"first\",\n order: \"pre\"\n },\n normalizedId,\n normalizedImporter,\n opts\n );\n if (isSetString(result)) {\n return result;\n } else if (isSetObject(result)) {\n return {\n ...result,\n id:\n result.virtual && options.prefix !== false\n ? `${VIRTUAL_MODULE_PREFIX}${result.id}`\n : result.id\n };\n }\n\n result = await ctx.api.callHook(\n \"resolveId\",\n {\n sequential: true,\n result: \"first\",\n order: \"normal\"\n },\n normalizedId,\n normalizedImporter,\n opts\n );\n if (isSetString(result)) {\n return result;\n } else if (isSetObject(result)) {\n return {\n ...result,\n id:\n result.virtual && options.prefix !== false\n ? `${VIRTUAL_MODULE_PREFIX}${result.id}`\n : result.id\n };\n }\n\n result = await ctx.resolve(\n normalizedId,\n normalizedImporter,\n defu(options.overrides ?? {}, {\n isFile: true,\n ...opts\n })\n );\n if (isSetObject(result)) {\n return {\n ...result,\n id:\n result.virtual && options.prefix !== false\n ? `${VIRTUAL_MODULE_PREFIX}${result.id}`\n : result.id\n };\n }\n\n result = await ctx.api.callHook(\n \"resolveId\",\n {\n sequential: true,\n result: \"first\",\n order: \"post\"\n },\n normalizedId,\n normalizedImporter,\n opts\n );\n if (isSetString(result)) {\n return result;\n } else if (isSetObject(result)) {\n return {\n ...result,\n id:\n result.virtual && options.prefix !== false\n ? `${VIRTUAL_MODULE_PREFIX}${result.id}`\n : result.id\n };\n }\n\n return null;\n },\n load: {\n filter:\n options.prefix !== false\n ? {\n id: {\n include: [VIRTUAL_MODULE_PREFIX_REGEX]\n }\n }\n : undefined,\n async handler(\n this: UnpluginBuildContext & UnpluginContext,\n id: string\n ): Promise<LoadResult | null | undefined> {\n const normalizedId = id.replace(VIRTUAL_MODULE_PREFIX_REGEX, \"\");\n\n let result = await ctx.api.callHook(\n \"load\",\n {\n sequential: true,\n result: \"first\",\n order: \"pre\"\n },\n normalizedId\n );\n if (result) {\n return result;\n }\n\n result = await ctx.api.callHook(\n \"load\",\n {\n sequential: true,\n result: \"first\",\n order: \"normal\"\n },\n normalizedId\n );\n if (result) {\n return result;\n }\n\n result = await ctx.load(normalizedId);\n if (result) {\n return result;\n }\n\n return ctx.api.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;CAC7C,MAAM,MAAM;AAEZ,QAAO;EACL,MAAM,UAEJ,IACA,UACA,OAEI,EAAE,SAAS,OAAO,EAC8B;GACpD,MAAM,eAAe,GAAG,QAAQ,6BAA6B,GAAG;GAChE,MAAM,qBAAqB,WACvB,SAAS,QAAQ,6BAA6B,GAAG,GACjD;GAEJ,IAAI,SAAS,MAAM,IAAI,IAAI,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,UAA2B,OAAO,OAClC,OAAO;IACd;AAGH,YAAS,MAAM,IAAI,IAAI,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,UAA2B,OAAO,OAClC,OAAO;IACd;AAGH,YAAS,MAAM,IAAI,QACjB,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,UAA2B,OAAO,OAClC,OAAO;IACd;AAGH,YAAS,MAAM,IAAI,IAAI,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,UAA2B,OAAO,OAClC,OAAO;IACd;AAGH,UAAO;;EAET,MAAM;GACJ,QACE,QAAQ,WAAW,QACf,EACE,IAAI,EACF,SAAS,CAAC,4BAA4B,EACvC,EACF,GACD;GACN,MAAM,QAEJ,IACwC;IACxC,MAAM,eAAe,GAAG,QAAQ,6BAA6B,GAAG;IAEhE,IAAI,SAAS,MAAM,IAAI,IAAI,SACzB,QACA;KACE,YAAY;KACZ,QAAQ;KACR,OAAO;KACR,EACD,aACD;AACD,QAAI,OACF,QAAO;AAGT,aAAS,MAAM,IAAI,IAAI,SACrB,QACA;KACE,YAAY;KACZ,QAAQ;KACR,OAAO;KACR,EACD,aACD;AACD,QAAI,OACF,QAAO;AAGT,aAAS,MAAM,IAAI,KAAK,aAAa;AACrC,QAAI,OACF,QAAO;AAGT,WAAO,IAAI,IAAI,SACb,QACA;KACE,YAAY;KACZ,QAAQ;KACR,OAAO;KACR,EACD,aACD;;GAEJ;EACF"}
|
|
@@ -45,7 +45,7 @@ function createUnpluginResolver(context, options = {}) {
|
|
|
45
45
|
*/
|
|
46
46
|
function createUnplugin(context, options = {}) {
|
|
47
47
|
const ctx = context;
|
|
48
|
-
(0, unplugin.setParseImpl)(ctx.parse);
|
|
48
|
+
(0, unplugin.setParseImpl)(ctx.parse.bind(ctx));
|
|
49
49
|
const name = options.name || "powerlines";
|
|
50
50
|
return () => {
|
|
51
51
|
const logger = ctx.extendLogger(!options.silenceHookLogging && name !== "powerlines" ? { source: name } : {});
|
|
@@ -54,11 +54,11 @@ function createUnplugin(context, options = {}) {
|
|
|
54
54
|
const { resolveId, load } = require_lib_unplugin_module_resolution.createUnpluginModuleResolutionFunctions(context, options);
|
|
55
55
|
async function buildStart() {
|
|
56
56
|
if (!options.silenceHookLogging) logger.debug("Powerlines build plugin starting...");
|
|
57
|
-
await ctx
|
|
57
|
+
await ctx.api.callHook("buildStart", { sequential: true });
|
|
58
58
|
}
|
|
59
59
|
async function transform(code, id) {
|
|
60
60
|
let transformed = code;
|
|
61
|
-
for (const hook of ctx
|
|
61
|
+
for (const hook of ctx.environment.selectHooks("transform")) {
|
|
62
62
|
const result = await hook.handler.apply(require_lib_unplugin_helpers.combineContexts(ctx, this), [require_lib_utilities_source_file.getString(transformed), id.replace(require_constants_virtual_modules.VIRTUAL_MODULE_PREFIX_REGEX, "")]);
|
|
63
63
|
if (result) transformed = result;
|
|
64
64
|
}
|
|
@@ -66,15 +66,15 @@ function createUnplugin(context, options = {}) {
|
|
|
66
66
|
}
|
|
67
67
|
async function buildEnd() {
|
|
68
68
|
if (!options.silenceHookLogging) logger.debug("Powerlines build plugin finishing...");
|
|
69
|
-
return ctx
|
|
69
|
+
return ctx.api.callHook("buildEnd", { sequential: true });
|
|
70
70
|
}
|
|
71
71
|
async function writeBundle() {
|
|
72
72
|
if (!options.silenceHookLogging) logger.debug("Finalizing Powerlines project output...");
|
|
73
|
-
return ctx
|
|
73
|
+
return ctx.api.callHook("writeBundle", { sequential: true });
|
|
74
74
|
}
|
|
75
75
|
return {
|
|
76
76
|
name: name.toLowerCase() === "powerlines" ? "powerlines" : `powerlines:${(0, _stryke_string_format_kebab_case.kebabCase)(name)}`,
|
|
77
|
-
api: ctx
|
|
77
|
+
api: ctx.api,
|
|
78
78
|
resolveId,
|
|
79
79
|
load,
|
|
80
80
|
transform,
|
|
@@ -43,7 +43,7 @@ function createUnpluginResolver(context, options = {}) {
|
|
|
43
43
|
*/
|
|
44
44
|
function createUnplugin(context, options = {}) {
|
|
45
45
|
const ctx = context;
|
|
46
|
-
setParseImpl(ctx.parse);
|
|
46
|
+
setParseImpl(ctx.parse.bind(ctx));
|
|
47
47
|
const name = options.name || "powerlines";
|
|
48
48
|
return () => {
|
|
49
49
|
const logger = ctx.extendLogger(!options.silenceHookLogging && name !== "powerlines" ? { source: name } : {});
|
|
@@ -52,11 +52,11 @@ function createUnplugin(context, options = {}) {
|
|
|
52
52
|
const { resolveId, load } = createUnpluginModuleResolutionFunctions(context, options);
|
|
53
53
|
async function buildStart() {
|
|
54
54
|
if (!options.silenceHookLogging) logger.debug("Powerlines build plugin starting...");
|
|
55
|
-
await ctx
|
|
55
|
+
await ctx.api.callHook("buildStart", { sequential: true });
|
|
56
56
|
}
|
|
57
57
|
async function transform(code, id) {
|
|
58
58
|
let transformed = code;
|
|
59
|
-
for (const hook of ctx
|
|
59
|
+
for (const hook of ctx.environment.selectHooks("transform")) {
|
|
60
60
|
const result = await hook.handler.apply(combineContexts(ctx, this), [getString(transformed), id.replace(VIRTUAL_MODULE_PREFIX_REGEX, "")]);
|
|
61
61
|
if (result) transformed = result;
|
|
62
62
|
}
|
|
@@ -64,15 +64,15 @@ function createUnplugin(context, options = {}) {
|
|
|
64
64
|
}
|
|
65
65
|
async function buildEnd() {
|
|
66
66
|
if (!options.silenceHookLogging) logger.debug("Powerlines build plugin finishing...");
|
|
67
|
-
return ctx
|
|
67
|
+
return ctx.api.callHook("buildEnd", { sequential: true });
|
|
68
68
|
}
|
|
69
69
|
async function writeBundle() {
|
|
70
70
|
if (!options.silenceHookLogging) logger.debug("Finalizing Powerlines project output...");
|
|
71
|
-
return ctx
|
|
71
|
+
return ctx.api.callHook("writeBundle", { sequential: true });
|
|
72
72
|
}
|
|
73
73
|
return {
|
|
74
74
|
name: name.toLowerCase() === "powerlines" ? "powerlines" : `powerlines:${kebabCase(name)}`,
|
|
75
|
-
api: ctx
|
|
75
|
+
api: ctx.api,
|
|
76
76
|
resolveId,
|
|
77
77
|
load,
|
|
78
78
|
transform,
|