@powerlines/core 0.13.5 → 0.13.7
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/index.cjs +1 -1
- package/dist/constants/index.mjs +1 -1
- package/dist/index.d.cts +2 -2
- package/dist/index.d.mts +2 -2
- package/dist/lib/logger.cjs +3 -2
- package/dist/lib/logger.d.cts +2 -0
- package/dist/lib/logger.d.cts.map +1 -1
- package/dist/lib/logger.d.mts +2 -0
- package/dist/lib/logger.d.mts.map +1 -1
- package/dist/lib/logger.mjs +3 -2
- package/dist/lib/logger.mjs.map +1 -1
- package/dist/lib/unplugin/plugin.cjs +3 -3
- package/dist/lib/unplugin/plugin.d.cts +8 -1
- package/dist/lib/unplugin/plugin.d.cts.map +1 -1
- package/dist/lib/unplugin/plugin.d.mts +8 -1
- package/dist/lib/unplugin/plugin.d.mts.map +1 -1
- package/dist/lib/unplugin/plugin.mjs +3 -3
- package/dist/lib/unplugin/plugin.mjs.map +1 -1
- package/dist/plugin-utils/build-helpers.cjs +1 -1
- package/dist/plugin-utils/build-helpers.mjs +1 -1
- package/dist/plugin-utils/build-helpers.mjs.map +1 -1
- package/dist/plugin-utils/helpers.cjs +20 -5
- package/dist/plugin-utils/helpers.d.cts +10 -3
- package/dist/plugin-utils/helpers.d.cts.map +1 -1
- package/dist/plugin-utils/helpers.d.mts +10 -3
- package/dist/plugin-utils/helpers.d.mts.map +1 -1
- package/dist/plugin-utils/helpers.mjs +19 -5
- package/dist/plugin-utils/helpers.mjs.map +1 -1
- package/dist/plugin-utils/index.cjs +2 -1
- package/dist/plugin-utils/index.d.cts +2 -2
- package/dist/plugin-utils/index.d.mts +2 -2
- package/dist/plugin-utils/index.mjs +2 -2
- package/dist/types/config.d.cts +3 -1
- package/dist/types/config.d.cts.map +1 -1
- package/dist/types/config.d.mts +3 -1
- package/dist/types/config.d.mts.map +1 -1
- package/dist/types/context.d.cts +14 -0
- package/dist/types/context.d.cts.map +1 -1
- package/dist/types/context.d.mts +14 -0
- package/dist/types/context.d.mts.map +1 -1
- package/dist/types/index.d.cts +1 -1
- package/dist/types/index.d.mts +1 -1
- package/package.json +8 -8
package/dist/constants/index.cjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
2
|
+
const require_environments = require('./environments.cjs');
|
|
2
3
|
const require_commands = require('./commands.cjs');
|
|
3
4
|
const require_plugin = require('./plugin.cjs');
|
|
4
|
-
const require_environments = require('./environments.cjs');
|
|
5
5
|
const require_fs = require('./fs.cjs');
|
|
6
6
|
const require_hooks = require('./hooks.cjs');
|
|
7
7
|
const require_meta = require('./meta.cjs');
|
package/dist/constants/index.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
+
import { CLIENT_ENVIRONMENT, DEFAULT_ENVIRONMENT, GLOBAL_ENVIRONMENT, RSC_ENVIRONMENT, SERVER_ENVIRONMENT, SSR_ENVIRONMENT } from "./environments.mjs";
|
|
1
2
|
import { SUPPORTED_COMMANDS } from "./commands.mjs";
|
|
2
3
|
import { BUILDER_VARIANTS, KNOWN_PLUGIN_FIELDS, PLUGIN_HOOKS_FIELDS, PLUGIN_NON_HOOK_FIELDS, UNPLUGIN_BUILDER_VARIANTS } from "./plugin.mjs";
|
|
3
|
-
import { CLIENT_ENVIRONMENT, DEFAULT_ENVIRONMENT, GLOBAL_ENVIRONMENT, RSC_ENVIRONMENT, SERVER_ENVIRONMENT, SSR_ENVIRONMENT } from "./environments.mjs";
|
|
4
4
|
import { STORAGE_PRESETS, __VFS_PATCH__, __VFS_REVERT__ } from "./fs.mjs";
|
|
5
5
|
import { HOOKS_LIST_ORDERS } from "./hooks.mjs";
|
|
6
6
|
import { CACHE_HASH_LENGTH, ROOT_HASH_LENGTH } from "./meta.mjs";
|
package/dist/index.d.cts
CHANGED
|
@@ -6,7 +6,7 @@ import { BasePlugin, HookFunctions, Hooks, Plugin, PluginHook, PluginHookFields,
|
|
|
6
6
|
import { CallHookOptions, HookListOrders, HooksList, HooksListItem, InferHookFunction, InferHookParameters, InferHookReturnType, InferHookThisType, __ΩCallHookOptions, __ΩHookListOrders, __ΩHooksList, __ΩHooksListItem, __ΩInferHookFunction, __ΩInferHookParameters, __ΩInferHookReturnType, __ΩInferHookThisType } from "./types/hooks.cjs";
|
|
7
7
|
import { DeepkitOptions, ParsedTypeScriptConfig, RawReflectionMode, ReflectionLevel, ReflectionMode, TSCompilerOptions, TSConfig, __ΩDeepkitOptions, __ΩParsedTypeScriptConfig, __ΩRawReflectionMode, __ΩReflectionLevel, __ΩReflectionMode, __ΩTSCompilerOptions, __ΩTSConfig } from "./types/tsconfig.cjs";
|
|
8
8
|
import { APIContext, BuildPluginContext, Context, EmitEntryOptions, EmitOptions, EnvironmentContext, EnvironmentContextPlugin, FetchOptions, InitContextOptions, MetaInfo, ParseOptions, PluginContext, ResolveResult, Resolver, SelectHookResult, SelectHookResultItem, SelectHooksOptions, SourceFile, TransformResult, UnimportContext, UnresolvedContext, WithUnpluginBuildContext, WorkerProcess, __ΩAPIContext, __ΩBuildPluginContext, __ΩContext, __ΩEmitEntryOptions, __ΩEmitOptions, __ΩEnvironmentContext, __ΩEnvironmentContextPlugin, __ΩFetchOptions, __ΩInitContextOptions, __ΩMetaInfo, __ΩParseOptions, __ΩPluginContext, __ΩResolveResult, __ΩResolver, __ΩSelectHookResult, __ΩSelectHookResultItem, __ΩSelectHooksOptions, __ΩSourceFile, __ΩTransformResult, __ΩUnimportContext, __ΩUnresolvedContext, __ΩWithUnpluginBuildContext, __ΩWorkerProcess } from "./types/context.cjs";
|
|
9
|
-
import { AnyOutputUserConfig, AnyUserConfig, BuildInlineConfig, CleanInlineConfig, Config, ConfigEnv, CopyConfig, CopyResolvedConfig, DeployInlineConfig, DocsInlineConfig, EnvironmentConfig, EnvironmentResolvedConfig, InitialUserConfig, InlineConfig, LintInlineConfig, LogFn, LogLevel, Logger, NewInlineConfig, OutputConfig, OutputResolvedConfig, ParsedUserConfig, PartialPlugin, PartialPluginFactory, PluginConfig, PluginConfigObject, PluginConfigTuple, PluginFactory, PowerlinesCommand, PrepareInlineConfig, ProjectType, ResolveConfig, ResolveResolvedConfig, ResolvedAssetGlob, ResolvedConfig, ResolvedEntryTypeDefinition, TypesInlineConfig, UserConfig, UserConfigFn, WorkspaceConfig, __ΩAnyOutputUserConfig, __ΩAnyUserConfig, __ΩBuildInlineConfig, __ΩCleanInlineConfig, __ΩConfig, __ΩConfigEnv, __ΩCopyConfig, __ΩCopyResolvedConfig, __ΩDeployInlineConfig, __ΩDocsInlineConfig, __ΩEnvironmentConfig, __ΩEnvironmentResolvedConfig, __ΩInitialUserConfig, __ΩInlineConfig, __ΩLintInlineConfig, __ΩLogFn, __ΩLogLevel, __ΩLogger, __ΩNewInlineConfig, __ΩOutputConfig, __ΩOutputResolvedConfig, __ΩParsedUserConfig, __ΩPartialPlugin, __ΩPartialPluginFactory, __ΩPluginConfig, __ΩPluginConfigObject, __ΩPluginConfigTuple, __ΩPluginFactory, __ΩPowerlinesCommand, __ΩPrepareInlineConfig, __ΩProjectType, __ΩResolveConfig, __ΩResolveResolvedConfig, __ΩResolvedAssetGlob, __ΩResolvedConfig, __ΩResolvedEntryTypeDefinition, __ΩTypesInlineConfig, __ΩUserConfig, __ΩUserConfigFn, __ΩWorkspaceConfig } from "./types/config.cjs";
|
|
9
|
+
import { AnyOutputUserConfig, AnyUserConfig, BuildInlineConfig, CleanInlineConfig, Config, ConfigEnv, CopyConfig, CopyResolvedConfig, DeployInlineConfig, DocsInlineConfig, EnvironmentConfig, EnvironmentResolvedConfig, InitialUserConfig, InlineConfig, LintInlineConfig, LogFn, LogLevel, LogLevelConfig, Logger, NewInlineConfig, OutputConfig, OutputResolvedConfig, ParsedUserConfig, PartialPlugin, PartialPluginFactory, PluginConfig, PluginConfigObject, PluginConfigTuple, PluginFactory, PowerlinesCommand, PrepareInlineConfig, ProjectType, ResolveConfig, ResolveResolvedConfig, ResolvedAssetGlob, ResolvedConfig, ResolvedEntryTypeDefinition, TypesInlineConfig, UserConfig, UserConfigFn, WorkspaceConfig, __ΩAnyOutputUserConfig, __ΩAnyUserConfig, __ΩBuildInlineConfig, __ΩCleanInlineConfig, __ΩConfig, __ΩConfigEnv, __ΩCopyConfig, __ΩCopyResolvedConfig, __ΩDeployInlineConfig, __ΩDocsInlineConfig, __ΩEnvironmentConfig, __ΩEnvironmentResolvedConfig, __ΩInitialUserConfig, __ΩInlineConfig, __ΩLintInlineConfig, __ΩLogFn, __ΩLogLevel, __ΩLogLevelConfig, __ΩLogger, __ΩNewInlineConfig, __ΩOutputConfig, __ΩOutputResolvedConfig, __ΩParsedUserConfig, __ΩPartialPlugin, __ΩPartialPluginFactory, __ΩPluginConfig, __ΩPluginConfigObject, __ΩPluginConfigTuple, __ΩPluginFactory, __ΩPowerlinesCommand, __ΩPrepareInlineConfig, __ΩProjectType, __ΩResolveConfig, __ΩResolveResolvedConfig, __ΩResolvedAssetGlob, __ΩResolvedConfig, __ΩResolvedEntryTypeDefinition, __ΩTypesInlineConfig, __ΩUserConfig, __ΩUserConfigFn, __ΩWorkspaceConfig } from "./types/config.cjs";
|
|
10
10
|
import { PartiallyResolvedContext, __ΩPartiallyResolvedContext, defineConfig, loadUserConfigFile, loadWorkspaceConfig } from "./lib/config.cjs";
|
|
11
11
|
import { getUniqueInputs, isResolvedEntryTypeDefinition, isTypeDefinition, resolveEntryOutput, resolveInput, resolveInputs, resolveInputsSync } from "./lib/entry.cjs";
|
|
12
12
|
import { CreateLogOptions, __ΩCreateLogOptions, colorBackground, colorText, createLog, extendLog, getTextColor } from "./lib/logger.cjs";
|
|
@@ -18,4 +18,4 @@ import { format, formatFolder } from "./lib/utilities/format.cjs";
|
|
|
18
18
|
import { getMagicString, getSourceFile, getString } from "./lib/utilities/source-file.cjs";
|
|
19
19
|
import { generateSourceMap } from "./lib/utilities/source-map.cjs";
|
|
20
20
|
import { writeFile } from "./lib/utilities/write-file.cjs";
|
|
21
|
-
export { API, APIContext, AnyOutputUserConfig, AnyUserConfig, BasePlugin, BuildInlineConfig, BuildPluginContext, BuilderVariant, CallHookOptions, CleanInlineConfig, CommandType, Commands, Config, ConfigEnv, Context, CopyConfig, CopyResolvedConfig, CreateLogOptions, CreateUnpluginModuleResolutionFunctionsOptions, CreateUnpluginOptions, CreateUnpluginResolverOptions, DeepkitOptions, DeployInlineConfig, DocsInlineConfig, EmitEntryOptions, EmitOptions, EnvironmentConfig, EnvironmentContext, EnvironmentContextPlugin, EnvironmentResolvedConfig, FetchOptions, FileHeaderOptions, HookFunctions, HookListOrders, Hooks, HooksList, HooksListItem, InferHookFunction, InferHookParameters, InferHookReturnType, InferHookThisType, InferUnpluginOptions, InferUnpluginVariant, InitContextOptions, InitialUserConfig, InlineConfig, LintInlineConfig, LogFn, LogLevel, Logger, MetaInfo, NewInlineConfig, OutputConfig, OutputResolvedConfig, ParseOptions, ParsedTypeScriptConfig, ParsedUserConfig, PartialPlugin, PartialPluginFactory, PartiallyResolvedContext, Plugin, PluginConfig, PluginConfigObject, PluginConfigTuple, PluginContext, PluginFactory, PluginHook, PluginHookFields, PluginHookObject, PluginHooks, PluginNonHookFields, PowerlinesCommand, PrepareInlineConfig, ProjectType, RawReflectionMode, ReflectionLevel, ReflectionMode, ResolveConfig, ResolveOptions, ResolveResolvedConfig, ResolveResult, ResolvedAssetGlob, ResolvedConfig, ResolvedEntryTypeDefinition, Resolver, SelectHookResult, SelectHookResultItem, SelectHooksOptions, SourceFile, StorageAdapter, StoragePort, StoragePreset, TSCompilerOptions, TSConfig, TransformResult, TypesInlineConfig, TypesResult, UnimportContext, UnpluginAsyncFactory, UnpluginBuilderVariant, UnpluginFactory, UnpluginHookFunctions, UnpluginOptions, UnpluginUserConfig, UnresolvedContext, UserConfig, UserConfigFn, VirtualFile, VirtualFileData, VirtualFileExtension, VirtualFileMetadata, VirtualFileSystemInterface, WithUnpluginBuildContext, WorkerProcess, WorkspaceConfig, WriteData, WriteOptions, __ΩAPI, __ΩAPIContext, __ΩAnyOutputUserConfig, __ΩAnyUserConfig, __ΩBasePlugin, __ΩBuildInlineConfig, __ΩBuildPluginContext, __ΩBuilderVariant, __ΩCallHookOptions, __ΩCleanInlineConfig, __ΩCommandType, __ΩCommands, __ΩConfig, __ΩConfigEnv, __ΩContext, __ΩCopyConfig, __ΩCopyResolvedConfig, __ΩCreateLogOptions, __ΩCreateUnpluginModuleResolutionFunctionsOptions, __ΩCreateUnpluginOptions, __ΩCreateUnpluginResolverOptions, __ΩDeepkitOptions, __ΩDeployInlineConfig, __ΩDocsInlineConfig, __ΩEmitEntryOptions, __ΩEmitOptions, __ΩEnvironmentConfig, __ΩEnvironmentContext, __ΩEnvironmentContextPlugin, __ΩEnvironmentResolvedConfig, __ΩFetchOptions, __ΩFileHeaderOptions, __ΩHookFunctions, __ΩHookListOrders, __ΩHooks, __ΩHooksList, __ΩHooksListItem, __ΩInferHookFunction, __ΩInferHookParameters, __ΩInferHookReturnType, __ΩInferHookThisType, __ΩInferUnpluginOptions, __ΩInferUnpluginVariant, __ΩInitContextOptions, __ΩInitialUserConfig, __ΩInlineConfig, __ΩLintInlineConfig, __ΩLogFn, __ΩLogLevel, __ΩLogger, __ΩMetaInfo, __ΩNewInlineConfig, __ΩOutputConfig, __ΩOutputResolvedConfig, __ΩParseOptions, __ΩParsedTypeScriptConfig, __ΩParsedUserConfig, __ΩPartialPlugin, __ΩPartialPluginFactory, __ΩPartiallyResolvedContext, __ΩPlugin, __ΩPluginConfig, __ΩPluginConfigObject, __ΩPluginConfigTuple, __ΩPluginContext, __ΩPluginFactory, __ΩPluginHook, __ΩPluginHookFields, __ΩPluginHookObject, __ΩPluginHooks, __ΩPluginNonHookFields, __ΩPowerlinesCommand, __ΩPrepareInlineConfig, __ΩProjectType, __ΩRawReflectionMode, __ΩReflectionLevel, __ΩReflectionMode, __ΩResolveConfig, __ΩResolveOptions, __ΩResolveResolvedConfig, __ΩResolveResult, __ΩResolvedAssetGlob, __ΩResolvedConfig, __ΩResolvedEntryTypeDefinition, __ΩResolver, __ΩSelectHookResult, __ΩSelectHookResultItem, __ΩSelectHooksOptions, __ΩSourceFile, __ΩStorageAdapter, __ΩStoragePort, __ΩStoragePreset, __ΩTSCompilerOptions, __ΩTSConfig, __ΩTransformResult, __ΩTypesInlineConfig, __ΩTypesResult, __ΩUnimportContext, __ΩUnpluginAsyncFactory, __ΩUnpluginBuilderVariant, __ΩUnpluginFactory, __ΩUnpluginHookFunctions, __ΩUnpluginOptions, __ΩUnpluginUserConfig, __ΩUnresolvedContext, __ΩUserConfig, __ΩUserConfigFn, __ΩVirtualFile, __ΩVirtualFileData, __ΩVirtualFileExtension, __ΩVirtualFileMetadata, __ΩVirtualFileSystemInterface, __ΩWithUnpluginBuildContext, __ΩWorkerProcess, __ΩWorkspaceConfig, __ΩWriteData, __ΩWriteOptions, colorBackground, colorText, combineContexts, createLog, createUnplugin, createUnpluginModuleResolutionFunctions, createUnpluginResolver, defineConfig, extendLog, format, formatFolder, generateSourceMap, getFileHeader, getFileHeaderWarning, getFileHeaderWarningText, getMagicString, getSourceFile, getString, getTextColor, getTypescriptFileHeader, getUniqueInputs, isResolvedEntryTypeDefinition, isTypeDefinition, isUnpluginBuilderVariant, loadUserConfigFile, loadWorkspaceConfig, resolveEntryOutput, resolveInput, resolveInputs, resolveInputsSync, writeFile };
|
|
21
|
+
export { API, APIContext, AnyOutputUserConfig, AnyUserConfig, BasePlugin, BuildInlineConfig, BuildPluginContext, BuilderVariant, CallHookOptions, CleanInlineConfig, CommandType, Commands, Config, ConfigEnv, Context, CopyConfig, CopyResolvedConfig, CreateLogOptions, CreateUnpluginModuleResolutionFunctionsOptions, CreateUnpluginOptions, CreateUnpluginResolverOptions, DeepkitOptions, DeployInlineConfig, DocsInlineConfig, EmitEntryOptions, EmitOptions, EnvironmentConfig, EnvironmentContext, EnvironmentContextPlugin, EnvironmentResolvedConfig, FetchOptions, FileHeaderOptions, HookFunctions, HookListOrders, Hooks, HooksList, HooksListItem, InferHookFunction, InferHookParameters, InferHookReturnType, InferHookThisType, InferUnpluginOptions, InferUnpluginVariant, InitContextOptions, InitialUserConfig, InlineConfig, LintInlineConfig, LogFn, LogLevel, LogLevelConfig, Logger, MetaInfo, NewInlineConfig, OutputConfig, OutputResolvedConfig, ParseOptions, ParsedTypeScriptConfig, ParsedUserConfig, PartialPlugin, PartialPluginFactory, PartiallyResolvedContext, Plugin, PluginConfig, PluginConfigObject, PluginConfigTuple, PluginContext, PluginFactory, PluginHook, PluginHookFields, PluginHookObject, PluginHooks, PluginNonHookFields, PowerlinesCommand, PrepareInlineConfig, ProjectType, RawReflectionMode, ReflectionLevel, ReflectionMode, ResolveConfig, ResolveOptions, ResolveResolvedConfig, ResolveResult, ResolvedAssetGlob, ResolvedConfig, ResolvedEntryTypeDefinition, Resolver, SelectHookResult, SelectHookResultItem, SelectHooksOptions, SourceFile, StorageAdapter, StoragePort, StoragePreset, TSCompilerOptions, TSConfig, TransformResult, TypesInlineConfig, TypesResult, UnimportContext, UnpluginAsyncFactory, UnpluginBuilderVariant, UnpluginFactory, UnpluginHookFunctions, UnpluginOptions, UnpluginUserConfig, UnresolvedContext, UserConfig, UserConfigFn, VirtualFile, VirtualFileData, VirtualFileExtension, VirtualFileMetadata, VirtualFileSystemInterface, WithUnpluginBuildContext, WorkerProcess, WorkspaceConfig, WriteData, WriteOptions, __ΩAPI, __ΩAPIContext, __ΩAnyOutputUserConfig, __ΩAnyUserConfig, __ΩBasePlugin, __ΩBuildInlineConfig, __ΩBuildPluginContext, __ΩBuilderVariant, __ΩCallHookOptions, __ΩCleanInlineConfig, __ΩCommandType, __ΩCommands, __ΩConfig, __ΩConfigEnv, __ΩContext, __ΩCopyConfig, __ΩCopyResolvedConfig, __ΩCreateLogOptions, __ΩCreateUnpluginModuleResolutionFunctionsOptions, __ΩCreateUnpluginOptions, __ΩCreateUnpluginResolverOptions, __ΩDeepkitOptions, __ΩDeployInlineConfig, __ΩDocsInlineConfig, __ΩEmitEntryOptions, __ΩEmitOptions, __ΩEnvironmentConfig, __ΩEnvironmentContext, __ΩEnvironmentContextPlugin, __ΩEnvironmentResolvedConfig, __ΩFetchOptions, __ΩFileHeaderOptions, __ΩHookFunctions, __ΩHookListOrders, __ΩHooks, __ΩHooksList, __ΩHooksListItem, __ΩInferHookFunction, __ΩInferHookParameters, __ΩInferHookReturnType, __ΩInferHookThisType, __ΩInferUnpluginOptions, __ΩInferUnpluginVariant, __ΩInitContextOptions, __ΩInitialUserConfig, __ΩInlineConfig, __ΩLintInlineConfig, __ΩLogFn, __ΩLogLevel, __ΩLogLevelConfig, __ΩLogger, __ΩMetaInfo, __ΩNewInlineConfig, __ΩOutputConfig, __ΩOutputResolvedConfig, __ΩParseOptions, __ΩParsedTypeScriptConfig, __ΩParsedUserConfig, __ΩPartialPlugin, __ΩPartialPluginFactory, __ΩPartiallyResolvedContext, __ΩPlugin, __ΩPluginConfig, __ΩPluginConfigObject, __ΩPluginConfigTuple, __ΩPluginContext, __ΩPluginFactory, __ΩPluginHook, __ΩPluginHookFields, __ΩPluginHookObject, __ΩPluginHooks, __ΩPluginNonHookFields, __ΩPowerlinesCommand, __ΩPrepareInlineConfig, __ΩProjectType, __ΩRawReflectionMode, __ΩReflectionLevel, __ΩReflectionMode, __ΩResolveConfig, __ΩResolveOptions, __ΩResolveResolvedConfig, __ΩResolveResult, __ΩResolvedAssetGlob, __ΩResolvedConfig, __ΩResolvedEntryTypeDefinition, __ΩResolver, __ΩSelectHookResult, __ΩSelectHookResultItem, __ΩSelectHooksOptions, __ΩSourceFile, __ΩStorageAdapter, __ΩStoragePort, __ΩStoragePreset, __ΩTSCompilerOptions, __ΩTSConfig, __ΩTransformResult, __ΩTypesInlineConfig, __ΩTypesResult, __ΩUnimportContext, __ΩUnpluginAsyncFactory, __ΩUnpluginBuilderVariant, __ΩUnpluginFactory, __ΩUnpluginHookFunctions, __ΩUnpluginOptions, __ΩUnpluginUserConfig, __ΩUnresolvedContext, __ΩUserConfig, __ΩUserConfigFn, __ΩVirtualFile, __ΩVirtualFileData, __ΩVirtualFileExtension, __ΩVirtualFileMetadata, __ΩVirtualFileSystemInterface, __ΩWithUnpluginBuildContext, __ΩWorkerProcess, __ΩWorkspaceConfig, __ΩWriteData, __ΩWriteOptions, colorBackground, colorText, combineContexts, createLog, createUnplugin, createUnpluginModuleResolutionFunctions, createUnpluginResolver, defineConfig, extendLog, format, formatFolder, generateSourceMap, getFileHeader, getFileHeaderWarning, getFileHeaderWarningText, getMagicString, getSourceFile, getString, getTextColor, getTypescriptFileHeader, getUniqueInputs, isResolvedEntryTypeDefinition, isTypeDefinition, isUnpluginBuilderVariant, loadUserConfigFile, loadWorkspaceConfig, resolveEntryOutput, resolveInput, resolveInputs, resolveInputsSync, writeFile };
|
package/dist/index.d.mts
CHANGED
|
@@ -6,7 +6,7 @@ import { BasePlugin, HookFunctions, Hooks, Plugin, PluginHook, PluginHookFields,
|
|
|
6
6
|
import { CallHookOptions, HookListOrders, HooksList, HooksListItem, InferHookFunction, InferHookParameters, InferHookReturnType, InferHookThisType, __ΩCallHookOptions, __ΩHookListOrders, __ΩHooksList, __ΩHooksListItem, __ΩInferHookFunction, __ΩInferHookParameters, __ΩInferHookReturnType, __ΩInferHookThisType } from "./types/hooks.mjs";
|
|
7
7
|
import { DeepkitOptions, ParsedTypeScriptConfig, RawReflectionMode, ReflectionLevel, ReflectionMode, TSCompilerOptions, TSConfig, __ΩDeepkitOptions, __ΩParsedTypeScriptConfig, __ΩRawReflectionMode, __ΩReflectionLevel, __ΩReflectionMode, __ΩTSCompilerOptions, __ΩTSConfig } from "./types/tsconfig.mjs";
|
|
8
8
|
import { APIContext, BuildPluginContext, Context, EmitEntryOptions, EmitOptions, EnvironmentContext, EnvironmentContextPlugin, FetchOptions, InitContextOptions, MetaInfo, ParseOptions, PluginContext, ResolveResult, Resolver, SelectHookResult, SelectHookResultItem, SelectHooksOptions, SourceFile, TransformResult, UnimportContext, UnresolvedContext, WithUnpluginBuildContext, WorkerProcess, __ΩAPIContext, __ΩBuildPluginContext, __ΩContext, __ΩEmitEntryOptions, __ΩEmitOptions, __ΩEnvironmentContext, __ΩEnvironmentContextPlugin, __ΩFetchOptions, __ΩInitContextOptions, __ΩMetaInfo, __ΩParseOptions, __ΩPluginContext, __ΩResolveResult, __ΩResolver, __ΩSelectHookResult, __ΩSelectHookResultItem, __ΩSelectHooksOptions, __ΩSourceFile, __ΩTransformResult, __ΩUnimportContext, __ΩUnresolvedContext, __ΩWithUnpluginBuildContext, __ΩWorkerProcess } from "./types/context.mjs";
|
|
9
|
-
import { AnyOutputUserConfig, AnyUserConfig, BuildInlineConfig, CleanInlineConfig, Config, ConfigEnv, CopyConfig, CopyResolvedConfig, DeployInlineConfig, DocsInlineConfig, EnvironmentConfig, EnvironmentResolvedConfig, InitialUserConfig, InlineConfig, LintInlineConfig, LogFn, LogLevel, Logger, NewInlineConfig, OutputConfig, OutputResolvedConfig, ParsedUserConfig, PartialPlugin, PartialPluginFactory, PluginConfig, PluginConfigObject, PluginConfigTuple, PluginFactory, PowerlinesCommand, PrepareInlineConfig, ProjectType, ResolveConfig, ResolveResolvedConfig, ResolvedAssetGlob, ResolvedConfig, ResolvedEntryTypeDefinition, TypesInlineConfig, UserConfig, UserConfigFn, WorkspaceConfig, __ΩAnyOutputUserConfig, __ΩAnyUserConfig, __ΩBuildInlineConfig, __ΩCleanInlineConfig, __ΩConfig, __ΩConfigEnv, __ΩCopyConfig, __ΩCopyResolvedConfig, __ΩDeployInlineConfig, __ΩDocsInlineConfig, __ΩEnvironmentConfig, __ΩEnvironmentResolvedConfig, __ΩInitialUserConfig, __ΩInlineConfig, __ΩLintInlineConfig, __ΩLogFn, __ΩLogLevel, __ΩLogger, __ΩNewInlineConfig, __ΩOutputConfig, __ΩOutputResolvedConfig, __ΩParsedUserConfig, __ΩPartialPlugin, __ΩPartialPluginFactory, __ΩPluginConfig, __ΩPluginConfigObject, __ΩPluginConfigTuple, __ΩPluginFactory, __ΩPowerlinesCommand, __ΩPrepareInlineConfig, __ΩProjectType, __ΩResolveConfig, __ΩResolveResolvedConfig, __ΩResolvedAssetGlob, __ΩResolvedConfig, __ΩResolvedEntryTypeDefinition, __ΩTypesInlineConfig, __ΩUserConfig, __ΩUserConfigFn, __ΩWorkspaceConfig } from "./types/config.mjs";
|
|
9
|
+
import { AnyOutputUserConfig, AnyUserConfig, BuildInlineConfig, CleanInlineConfig, Config, ConfigEnv, CopyConfig, CopyResolvedConfig, DeployInlineConfig, DocsInlineConfig, EnvironmentConfig, EnvironmentResolvedConfig, InitialUserConfig, InlineConfig, LintInlineConfig, LogFn, LogLevel, LogLevelConfig, Logger, NewInlineConfig, OutputConfig, OutputResolvedConfig, ParsedUserConfig, PartialPlugin, PartialPluginFactory, PluginConfig, PluginConfigObject, PluginConfigTuple, PluginFactory, PowerlinesCommand, PrepareInlineConfig, ProjectType, ResolveConfig, ResolveResolvedConfig, ResolvedAssetGlob, ResolvedConfig, ResolvedEntryTypeDefinition, TypesInlineConfig, UserConfig, UserConfigFn, WorkspaceConfig, __ΩAnyOutputUserConfig, __ΩAnyUserConfig, __ΩBuildInlineConfig, __ΩCleanInlineConfig, __ΩConfig, __ΩConfigEnv, __ΩCopyConfig, __ΩCopyResolvedConfig, __ΩDeployInlineConfig, __ΩDocsInlineConfig, __ΩEnvironmentConfig, __ΩEnvironmentResolvedConfig, __ΩInitialUserConfig, __ΩInlineConfig, __ΩLintInlineConfig, __ΩLogFn, __ΩLogLevel, __ΩLogLevelConfig, __ΩLogger, __ΩNewInlineConfig, __ΩOutputConfig, __ΩOutputResolvedConfig, __ΩParsedUserConfig, __ΩPartialPlugin, __ΩPartialPluginFactory, __ΩPluginConfig, __ΩPluginConfigObject, __ΩPluginConfigTuple, __ΩPluginFactory, __ΩPowerlinesCommand, __ΩPrepareInlineConfig, __ΩProjectType, __ΩResolveConfig, __ΩResolveResolvedConfig, __ΩResolvedAssetGlob, __ΩResolvedConfig, __ΩResolvedEntryTypeDefinition, __ΩTypesInlineConfig, __ΩUserConfig, __ΩUserConfigFn, __ΩWorkspaceConfig } from "./types/config.mjs";
|
|
10
10
|
import { PartiallyResolvedContext, __ΩPartiallyResolvedContext, defineConfig, loadUserConfigFile, loadWorkspaceConfig } from "./lib/config.mjs";
|
|
11
11
|
import { getUniqueInputs, isResolvedEntryTypeDefinition, isTypeDefinition, resolveEntryOutput, resolveInput, resolveInputs, resolveInputsSync } from "./lib/entry.mjs";
|
|
12
12
|
import { CreateLogOptions, __ΩCreateLogOptions, colorBackground, colorText, createLog, extendLog, getTextColor } from "./lib/logger.mjs";
|
|
@@ -18,4 +18,4 @@ import { format, formatFolder } from "./lib/utilities/format.mjs";
|
|
|
18
18
|
import { getMagicString, getSourceFile, getString } from "./lib/utilities/source-file.mjs";
|
|
19
19
|
import { generateSourceMap } from "./lib/utilities/source-map.mjs";
|
|
20
20
|
import { writeFile } from "./lib/utilities/write-file.mjs";
|
|
21
|
-
export { API, APIContext, AnyOutputUserConfig, AnyUserConfig, BasePlugin, BuildInlineConfig, BuildPluginContext, BuilderVariant, CallHookOptions, CleanInlineConfig, CommandType, Commands, Config, ConfigEnv, Context, CopyConfig, CopyResolvedConfig, CreateLogOptions, CreateUnpluginModuleResolutionFunctionsOptions, CreateUnpluginOptions, CreateUnpluginResolverOptions, DeepkitOptions, DeployInlineConfig, DocsInlineConfig, EmitEntryOptions, EmitOptions, EnvironmentConfig, EnvironmentContext, EnvironmentContextPlugin, EnvironmentResolvedConfig, FetchOptions, FileHeaderOptions, HookFunctions, HookListOrders, Hooks, HooksList, HooksListItem, InferHookFunction, InferHookParameters, InferHookReturnType, InferHookThisType, InferUnpluginOptions, InferUnpluginVariant, InitContextOptions, InitialUserConfig, InlineConfig, LintInlineConfig, LogFn, LogLevel, Logger, MetaInfo, NewInlineConfig, OutputConfig, OutputResolvedConfig, ParseOptions, ParsedTypeScriptConfig, ParsedUserConfig, PartialPlugin, PartialPluginFactory, PartiallyResolvedContext, Plugin, PluginConfig, PluginConfigObject, PluginConfigTuple, PluginContext, PluginFactory, PluginHook, PluginHookFields, PluginHookObject, PluginHooks, PluginNonHookFields, PowerlinesCommand, PrepareInlineConfig, ProjectType, RawReflectionMode, ReflectionLevel, ReflectionMode, ResolveConfig, ResolveOptions, ResolveResolvedConfig, ResolveResult, ResolvedAssetGlob, ResolvedConfig, ResolvedEntryTypeDefinition, Resolver, SelectHookResult, SelectHookResultItem, SelectHooksOptions, SourceFile, StorageAdapter, StoragePort, StoragePreset, TSCompilerOptions, TSConfig, TransformResult, TypesInlineConfig, TypesResult, UnimportContext, UnpluginAsyncFactory, UnpluginBuilderVariant, UnpluginFactory, UnpluginHookFunctions, UnpluginOptions, UnpluginUserConfig, UnresolvedContext, UserConfig, UserConfigFn, VirtualFile, VirtualFileData, VirtualFileExtension, VirtualFileMetadata, VirtualFileSystemInterface, WithUnpluginBuildContext, WorkerProcess, WorkspaceConfig, WriteData, WriteOptions, __ΩAPI, __ΩAPIContext, __ΩAnyOutputUserConfig, __ΩAnyUserConfig, __ΩBasePlugin, __ΩBuildInlineConfig, __ΩBuildPluginContext, __ΩBuilderVariant, __ΩCallHookOptions, __ΩCleanInlineConfig, __ΩCommandType, __ΩCommands, __ΩConfig, __ΩConfigEnv, __ΩContext, __ΩCopyConfig, __ΩCopyResolvedConfig, __ΩCreateLogOptions, __ΩCreateUnpluginModuleResolutionFunctionsOptions, __ΩCreateUnpluginOptions, __ΩCreateUnpluginResolverOptions, __ΩDeepkitOptions, __ΩDeployInlineConfig, __ΩDocsInlineConfig, __ΩEmitEntryOptions, __ΩEmitOptions, __ΩEnvironmentConfig, __ΩEnvironmentContext, __ΩEnvironmentContextPlugin, __ΩEnvironmentResolvedConfig, __ΩFetchOptions, __ΩFileHeaderOptions, __ΩHookFunctions, __ΩHookListOrders, __ΩHooks, __ΩHooksList, __ΩHooksListItem, __ΩInferHookFunction, __ΩInferHookParameters, __ΩInferHookReturnType, __ΩInferHookThisType, __ΩInferUnpluginOptions, __ΩInferUnpluginVariant, __ΩInitContextOptions, __ΩInitialUserConfig, __ΩInlineConfig, __ΩLintInlineConfig, __ΩLogFn, __ΩLogLevel, __ΩLogger, __ΩMetaInfo, __ΩNewInlineConfig, __ΩOutputConfig, __ΩOutputResolvedConfig, __ΩParseOptions, __ΩParsedTypeScriptConfig, __ΩParsedUserConfig, __ΩPartialPlugin, __ΩPartialPluginFactory, __ΩPartiallyResolvedContext, __ΩPlugin, __ΩPluginConfig, __ΩPluginConfigObject, __ΩPluginConfigTuple, __ΩPluginContext, __ΩPluginFactory, __ΩPluginHook, __ΩPluginHookFields, __ΩPluginHookObject, __ΩPluginHooks, __ΩPluginNonHookFields, __ΩPowerlinesCommand, __ΩPrepareInlineConfig, __ΩProjectType, __ΩRawReflectionMode, __ΩReflectionLevel, __ΩReflectionMode, __ΩResolveConfig, __ΩResolveOptions, __ΩResolveResolvedConfig, __ΩResolveResult, __ΩResolvedAssetGlob, __ΩResolvedConfig, __ΩResolvedEntryTypeDefinition, __ΩResolver, __ΩSelectHookResult, __ΩSelectHookResultItem, __ΩSelectHooksOptions, __ΩSourceFile, __ΩStorageAdapter, __ΩStoragePort, __ΩStoragePreset, __ΩTSCompilerOptions, __ΩTSConfig, __ΩTransformResult, __ΩTypesInlineConfig, __ΩTypesResult, __ΩUnimportContext, __ΩUnpluginAsyncFactory, __ΩUnpluginBuilderVariant, __ΩUnpluginFactory, __ΩUnpluginHookFunctions, __ΩUnpluginOptions, __ΩUnpluginUserConfig, __ΩUnresolvedContext, __ΩUserConfig, __ΩUserConfigFn, __ΩVirtualFile, __ΩVirtualFileData, __ΩVirtualFileExtension, __ΩVirtualFileMetadata, __ΩVirtualFileSystemInterface, __ΩWithUnpluginBuildContext, __ΩWorkerProcess, __ΩWorkspaceConfig, __ΩWriteData, __ΩWriteOptions, colorBackground, colorText, combineContexts, createLog, createUnplugin, createUnpluginModuleResolutionFunctions, createUnpluginResolver, defineConfig, extendLog, format, formatFolder, generateSourceMap, getFileHeader, getFileHeaderWarning, getFileHeaderWarningText, getMagicString, getSourceFile, getString, getTextColor, getTypescriptFileHeader, getUniqueInputs, isResolvedEntryTypeDefinition, isTypeDefinition, isUnpluginBuilderVariant, loadUserConfigFile, loadWorkspaceConfig, resolveEntryOutput, resolveInput, resolveInputs, resolveInputsSync, writeFile };
|
|
21
|
+
export { API, APIContext, AnyOutputUserConfig, AnyUserConfig, BasePlugin, BuildInlineConfig, BuildPluginContext, BuilderVariant, CallHookOptions, CleanInlineConfig, CommandType, Commands, Config, ConfigEnv, Context, CopyConfig, CopyResolvedConfig, CreateLogOptions, CreateUnpluginModuleResolutionFunctionsOptions, CreateUnpluginOptions, CreateUnpluginResolverOptions, DeepkitOptions, DeployInlineConfig, DocsInlineConfig, EmitEntryOptions, EmitOptions, EnvironmentConfig, EnvironmentContext, EnvironmentContextPlugin, EnvironmentResolvedConfig, FetchOptions, FileHeaderOptions, HookFunctions, HookListOrders, Hooks, HooksList, HooksListItem, InferHookFunction, InferHookParameters, InferHookReturnType, InferHookThisType, InferUnpluginOptions, InferUnpluginVariant, InitContextOptions, InitialUserConfig, InlineConfig, LintInlineConfig, LogFn, LogLevel, LogLevelConfig, Logger, MetaInfo, NewInlineConfig, OutputConfig, OutputResolvedConfig, ParseOptions, ParsedTypeScriptConfig, ParsedUserConfig, PartialPlugin, PartialPluginFactory, PartiallyResolvedContext, Plugin, PluginConfig, PluginConfigObject, PluginConfigTuple, PluginContext, PluginFactory, PluginHook, PluginHookFields, PluginHookObject, PluginHooks, PluginNonHookFields, PowerlinesCommand, PrepareInlineConfig, ProjectType, RawReflectionMode, ReflectionLevel, ReflectionMode, ResolveConfig, ResolveOptions, ResolveResolvedConfig, ResolveResult, ResolvedAssetGlob, ResolvedConfig, ResolvedEntryTypeDefinition, Resolver, SelectHookResult, SelectHookResultItem, SelectHooksOptions, SourceFile, StorageAdapter, StoragePort, StoragePreset, TSCompilerOptions, TSConfig, TransformResult, TypesInlineConfig, TypesResult, UnimportContext, UnpluginAsyncFactory, UnpluginBuilderVariant, UnpluginFactory, UnpluginHookFunctions, UnpluginOptions, UnpluginUserConfig, UnresolvedContext, UserConfig, UserConfigFn, VirtualFile, VirtualFileData, VirtualFileExtension, VirtualFileMetadata, VirtualFileSystemInterface, WithUnpluginBuildContext, WorkerProcess, WorkspaceConfig, WriteData, WriteOptions, __ΩAPI, __ΩAPIContext, __ΩAnyOutputUserConfig, __ΩAnyUserConfig, __ΩBasePlugin, __ΩBuildInlineConfig, __ΩBuildPluginContext, __ΩBuilderVariant, __ΩCallHookOptions, __ΩCleanInlineConfig, __ΩCommandType, __ΩCommands, __ΩConfig, __ΩConfigEnv, __ΩContext, __ΩCopyConfig, __ΩCopyResolvedConfig, __ΩCreateLogOptions, __ΩCreateUnpluginModuleResolutionFunctionsOptions, __ΩCreateUnpluginOptions, __ΩCreateUnpluginResolverOptions, __ΩDeepkitOptions, __ΩDeployInlineConfig, __ΩDocsInlineConfig, __ΩEmitEntryOptions, __ΩEmitOptions, __ΩEnvironmentConfig, __ΩEnvironmentContext, __ΩEnvironmentContextPlugin, __ΩEnvironmentResolvedConfig, __ΩFetchOptions, __ΩFileHeaderOptions, __ΩHookFunctions, __ΩHookListOrders, __ΩHooks, __ΩHooksList, __ΩHooksListItem, __ΩInferHookFunction, __ΩInferHookParameters, __ΩInferHookReturnType, __ΩInferHookThisType, __ΩInferUnpluginOptions, __ΩInferUnpluginVariant, __ΩInitContextOptions, __ΩInitialUserConfig, __ΩInlineConfig, __ΩLintInlineConfig, __ΩLogFn, __ΩLogLevel, __ΩLogLevelConfig, __ΩLogger, __ΩMetaInfo, __ΩNewInlineConfig, __ΩOutputConfig, __ΩOutputResolvedConfig, __ΩParseOptions, __ΩParsedTypeScriptConfig, __ΩParsedUserConfig, __ΩPartialPlugin, __ΩPartialPluginFactory, __ΩPartiallyResolvedContext, __ΩPlugin, __ΩPluginConfig, __ΩPluginConfigObject, __ΩPluginConfigTuple, __ΩPluginContext, __ΩPluginFactory, __ΩPluginHook, __ΩPluginHookFields, __ΩPluginHookObject, __ΩPluginHooks, __ΩPluginNonHookFields, __ΩPowerlinesCommand, __ΩPrepareInlineConfig, __ΩProjectType, __ΩRawReflectionMode, __ΩReflectionLevel, __ΩReflectionMode, __ΩResolveConfig, __ΩResolveOptions, __ΩResolveResolvedConfig, __ΩResolveResult, __ΩResolvedAssetGlob, __ΩResolvedConfig, __ΩResolvedEntryTypeDefinition, __ΩResolver, __ΩSelectHookResult, __ΩSelectHookResultItem, __ΩSelectHooksOptions, __ΩSourceFile, __ΩStorageAdapter, __ΩStoragePort, __ΩStoragePreset, __ΩTSCompilerOptions, __ΩTSConfig, __ΩTransformResult, __ΩTypesInlineConfig, __ΩTypesResult, __ΩUnimportContext, __ΩUnpluginAsyncFactory, __ΩUnpluginBuilderVariant, __ΩUnpluginFactory, __ΩUnpluginHookFunctions, __ΩUnpluginOptions, __ΩUnpluginUserConfig, __ΩUnresolvedContext, __ΩUserConfig, __ΩUserConfigFn, __ΩVirtualFile, __ΩVirtualFileData, __ΩVirtualFileExtension, __ΩVirtualFileMetadata, __ΩVirtualFileSystemInterface, __ΩWithUnpluginBuildContext, __ΩWorkerProcess, __ΩWorkspaceConfig, __ΩWriteData, __ΩWriteOptions, colorBackground, colorText, combineContexts, createLog, createUnplugin, createUnpluginModuleResolutionFunctions, createUnpluginResolver, defineConfig, extendLog, format, formatFolder, generateSourceMap, getFileHeader, getFileHeaderWarning, getFileHeaderWarningText, getMagicString, getSourceFile, getString, getTextColor, getTypescriptFileHeader, getUniqueInputs, isResolvedEntryTypeDefinition, isTypeDefinition, isUnpluginBuilderVariant, loadUserConfigFile, loadWorkspaceConfig, resolveEntryOutput, resolveInput, resolveInputs, resolveInputsSync, writeFile };
|
package/dist/lib/logger.cjs
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
2
2
|
const require_runtime = require('../_virtual/_rolldown/runtime.cjs');
|
|
3
|
+
const require_environments = require('../constants/environments.cjs');
|
|
3
4
|
let _storm_software_config_tools_logger = require("@storm-software/config-tools/logger");
|
|
4
5
|
let _storm_software_config_tools_types = require("@storm-software/config-tools/types");
|
|
5
6
|
let _storm_software_config_tools_utilities_colors = require("@storm-software/config-tools/utilities/colors");
|
|
@@ -24,7 +25,7 @@ const createLog = (name, options = {}) => {
|
|
|
24
25
|
return (type, ...args) => (0, _storm_software_config_tools_logger.getLogFn)((0, _storm_software_config_tools_logger.getLogLevel)(type), {
|
|
25
26
|
...options,
|
|
26
27
|
logLevel
|
|
27
|
-
})(`${chalk.default.bold.hex((0, _storm_software_config_tools_utilities_colors.getColor)("brand", options))(`${name ? (0, _stryke_string_format_kebab_case.kebabCase)(name) : ""}${options.
|
|
28
|
+
})(`${chalk.default.bold.hex((0, _storm_software_config_tools_utilities_colors.getColor)("brand", options))(`${name ? (0, _stryke_string_format_kebab_case.kebabCase)(name) : ""}${options.command ? chalk.default.dim(` [${options.command}]`) : ""}${name ? chalk.default.gray(" > ") : ""}${options.name ? `${(0, _stryke_string_format_kebab_case.kebabCase)(options.name)}${chalk.default.gray(" > ")}` : ""}${options.environment && options.environment !== "default" ? `${(0, _stryke_string_format_kebab_case.kebabCase)(options.environment)}${chalk.default.gray(" > ")}` : ""}`)}${args.join(" ")} `.trim());
|
|
28
29
|
};
|
|
29
30
|
const BADGE_COLORS = [
|
|
30
31
|
"#00A0DD",
|
|
@@ -87,7 +88,7 @@ const colorBackground = (text) => {
|
|
|
87
88
|
* @returns A new logging function that includes the badge in its output.
|
|
88
89
|
*/
|
|
89
90
|
const extendLog = (logFn, name) => {
|
|
90
|
-
return (type, ...args) => logFn(type,
|
|
91
|
+
return (type, ...args) => logFn(type, `${colorBackground(name)} ${args.filter(Boolean).map((arg) => String(arg).trim()).join(" ")} `);
|
|
91
92
|
};
|
|
92
93
|
|
|
93
94
|
//#endregion
|
package/dist/lib/logger.d.cts
CHANGED
|
@@ -4,6 +4,8 @@ import { LogLevelLabel } from "@storm-software/config-tools/types";
|
|
|
4
4
|
//#region src/lib/logger.d.ts
|
|
5
5
|
interface CreateLogOptions {
|
|
6
6
|
name?: string;
|
|
7
|
+
command?: string;
|
|
8
|
+
environment?: string;
|
|
7
9
|
logLevel?: LogLevelLabel | null;
|
|
8
10
|
customLogger?: LogFn;
|
|
9
11
|
colors?: WorkspaceConfig["colors"];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"logger.d.cts","names":[],"sources":["../../src/lib/logger.ts"],"mappings":";;;;
|
|
1
|
+
{"version":3,"file":"logger.d.cts","names":[],"sources":["../../src/lib/logger.ts"],"mappings":";;;;UA4BiB,gBAAA;EACf,IAAA;EACA,OAAA;EACA,WAAA;EACA,QAAA,GAAW,aAAA;EACX,YAAA,GAAe,KAAA;EACf,MAAA,GAAS,eAAA;AAAA;;;;;;;;cAUE,SAAA,GACX,IAAA,iBACA,OAAA,GAAS,gBAAA,KACR,KAAA;;;;;;;cAiEU,YAAA,GAAgB,IAAA;;;;;;;cAiBhB,SAAA,GAAa,IAAA;;;AAjB1B;;;;cA6Ba,eAAA,GAAmB,IAAA;AAZhC;;;;;AAYA;;AAZA,cAyBa,SAAA,GAAa,KAAA,EAAO,KAAA,EAAO,IAAA,aAAe,KAAA;AAAA"}
|
package/dist/lib/logger.d.mts
CHANGED
|
@@ -4,6 +4,8 @@ import { LogLevelLabel } from "@storm-software/config-tools/types";
|
|
|
4
4
|
//#region src/lib/logger.d.ts
|
|
5
5
|
interface CreateLogOptions {
|
|
6
6
|
name?: string;
|
|
7
|
+
command?: string;
|
|
8
|
+
environment?: string;
|
|
7
9
|
logLevel?: LogLevelLabel | null;
|
|
8
10
|
customLogger?: LogFn;
|
|
9
11
|
colors?: WorkspaceConfig["colors"];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"logger.d.mts","names":[],"sources":["../../src/lib/logger.ts"],"mappings":";;;;
|
|
1
|
+
{"version":3,"file":"logger.d.mts","names":[],"sources":["../../src/lib/logger.ts"],"mappings":";;;;UA4BiB,gBAAA;EACf,IAAA;EACA,OAAA;EACA,WAAA;EACA,QAAA,GAAW,aAAA;EACX,YAAA,GAAe,KAAA;EACf,MAAA,GAAS,eAAA;AAAA;;;;;;;;cAUE,SAAA,GACX,IAAA,iBACA,OAAA,GAAS,gBAAA,KACR,KAAA;;;;;;;cAiEU,YAAA,GAAgB,IAAA;;;;;;;cAiBhB,SAAA,GAAa,IAAA;;;AAjB1B;;;;cA6Ba,eAAA,GAAmB,IAAA;AAZhC;;;;;AAYA;;AAZA,cAyBa,SAAA,GAAa,KAAA,EAAO,KAAA,EAAO,IAAA,aAAe,KAAA;AAAA"}
|
package/dist/lib/logger.mjs
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { DEFAULT_ENVIRONMENT } from "../constants/environments.mjs";
|
|
1
2
|
import { getLogFn, getLogLevel } from "@storm-software/config-tools/logger";
|
|
2
3
|
import { LogLevelLabel } from "@storm-software/config-tools/types";
|
|
3
4
|
import { getColor } from "@storm-software/config-tools/utilities/colors";
|
|
@@ -21,7 +22,7 @@ const createLog = (name, options = {}) => {
|
|
|
21
22
|
return (type, ...args) => getLogFn(getLogLevel(type), {
|
|
22
23
|
...options,
|
|
23
24
|
logLevel
|
|
24
|
-
})(`${chalk.bold.hex(getColor("brand", options))(`${name ? kebabCase(name) : ""}${options.
|
|
25
|
+
})(`${chalk.bold.hex(getColor("brand", options))(`${name ? kebabCase(name) : ""}${options.command ? chalk.dim(` [${options.command}]`) : ""}${name ? chalk.gray(" > ") : ""}${options.name ? `${kebabCase(options.name)}${chalk.gray(" > ")}` : ""}${options.environment && options.environment !== "default" ? `${kebabCase(options.environment)}${chalk.gray(" > ")}` : ""}`)}${args.join(" ")} `.trim());
|
|
25
26
|
};
|
|
26
27
|
const BADGE_COLORS = [
|
|
27
28
|
"#00A0DD",
|
|
@@ -84,7 +85,7 @@ const colorBackground = (text) => {
|
|
|
84
85
|
* @returns A new logging function that includes the badge in its output.
|
|
85
86
|
*/
|
|
86
87
|
const extendLog = (logFn, name) => {
|
|
87
|
-
return (type, ...args) => logFn(type,
|
|
88
|
+
return (type, ...args) => logFn(type, `${colorBackground(name)} ${args.filter(Boolean).map((arg) => String(arg).trim()).join(" ")} `);
|
|
88
89
|
};
|
|
89
90
|
|
|
90
91
|
//#endregion
|
package/dist/lib/logger.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"logger.mjs","names":[],"sources":["../../src/lib/logger.ts"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Powerlines\n\n This code was released as part of the Powerlines project. Powerlines\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/powerlines.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/powerlines\n Documentation: https://docs.stormsoftware.com/projects/powerlines\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport { getLogFn, getLogLevel } from \"@storm-software/config-tools/logger\";\nimport { LogLevelLabel } from \"@storm-software/config-tools/types\";\nimport { getColor } from \"@storm-software/config-tools/utilities/colors\";\nimport { noop } from \"@stryke/helpers/noop\";\nimport { kebabCase } from \"@stryke/string-format/kebab-case\";\nimport { titleCase } from \"@stryke/string-format/title-case\";\nimport chalk from \"chalk\";\nimport type { LogFn, WorkspaceConfig } from \"../types\";\n\nexport interface CreateLogOptions {\n name?: string;\n logLevel?: LogLevelLabel | null;\n customLogger?: LogFn;\n colors?: WorkspaceConfig[\"colors\"];\n}\n\n/**\n * Create a logging function with a specific name and options.\n *\n * @param name - The name of the logging function.\n * @param options - The options to configure the logging function.\n * @returns A logging function.\n */\nexport const createLog = (\n name: string | null,\n options: CreateLogOptions = {}\n): LogFn => {\n const logLevel =\n options.logLevel === null\n ? LogLevelLabel.SILENT\n : options.logLevel || LogLevelLabel.INFO;\n if (logLevel === LogLevelLabel.SILENT) {\n return noop;\n }\n\n if (options.customLogger) {\n return options.customLogger;\n }\n\n return (type: LogLevelLabel, ...args: string[]) =>\n getLogFn(getLogLevel(type), {\n ...options,\n logLevel\n })(\n `${chalk.bold.hex(\n getColor(\"brand\", options as Parameters<typeof getColor>[1])\n )(\n `${name ? kebabCase(name) : \"\"}${options.
|
|
1
|
+
{"version":3,"file":"logger.mjs","names":[],"sources":["../../src/lib/logger.ts"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Powerlines\n\n This code was released as part of the Powerlines project. Powerlines\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/powerlines.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/powerlines\n Documentation: https://docs.stormsoftware.com/projects/powerlines\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport { getLogFn, getLogLevel } from \"@storm-software/config-tools/logger\";\nimport { LogLevelLabel } from \"@storm-software/config-tools/types\";\nimport { getColor } from \"@storm-software/config-tools/utilities/colors\";\nimport { noop } from \"@stryke/helpers/noop\";\nimport { kebabCase } from \"@stryke/string-format/kebab-case\";\nimport { titleCase } from \"@stryke/string-format/title-case\";\nimport chalk from \"chalk\";\nimport { DEFAULT_ENVIRONMENT } from \"../constants/environments\";\nimport type { LogFn, WorkspaceConfig } from \"../types\";\n\nexport interface CreateLogOptions {\n name?: string;\n command?: string;\n environment?: string;\n logLevel?: LogLevelLabel | null;\n customLogger?: LogFn;\n colors?: WorkspaceConfig[\"colors\"];\n}\n\n/**\n * Create a logging function with a specific name and options.\n *\n * @param name - The name of the logging function.\n * @param options - The options to configure the logging function.\n * @returns A logging function.\n */\nexport const createLog = (\n name: string | null,\n options: CreateLogOptions = {}\n): LogFn => {\n const logLevel =\n options.logLevel === null\n ? LogLevelLabel.SILENT\n : options.logLevel || LogLevelLabel.INFO;\n if (logLevel === LogLevelLabel.SILENT) {\n return noop;\n }\n\n if (options.customLogger) {\n return options.customLogger;\n }\n\n return (type: LogLevelLabel, ...args: string[]) =>\n getLogFn(getLogLevel(type), {\n ...options,\n logLevel\n })(\n `${chalk.bold.hex(\n getColor(\"brand\", options as Parameters<typeof getColor>[1])\n )(\n `${name ? kebabCase(name) : \"\"}${\n options.command ? chalk.dim(` [${options.command}]`) : \"\"\n }${name ? chalk.gray(\" > \") : \"\"}${\n options.name ? `${kebabCase(options.name)}${chalk.gray(\" > \")}` : \"\"\n }${\n options.environment && options.environment !== DEFAULT_ENVIRONMENT\n ? `${kebabCase(options.environment)}${chalk.gray(\" > \")}`\n : \"\"\n }`\n )}${args.join(\" \")} `.trim()\n );\n};\n\nconst BADGE_COLORS = [\n \"#00A0DD\",\n \"#6FCE4E\",\n \"#FBBF24\",\n \"#F43F5E\",\n \"#3B82F6\",\n \"#A855F7\",\n \"#469592\",\n \"#288EDF\",\n \"#D8B4FE\",\n \"#10B981\",\n \"#EF4444\",\n \"#F0EC56\",\n \"#F472B6\",\n \"#22D3EE\",\n \"#EAB308\",\n \"#84CC16\",\n \"#F87171\",\n \"#0EA5E9\",\n \"#D946EF\",\n \"#FACC15\",\n \"#34D399\",\n \"#8B5CF6\"\n] as const;\n\n/**\n * Generate a consistent color based on the input text.\n *\n * @param text - The input text to generate the color from.\n * @return A hexadecimal color string.\n */\nexport const getTextColor = (text: string): string => {\n return (\n BADGE_COLORS[\n text\n .split(\"\")\n .map(char => char.charCodeAt(0))\n .reduce((ret, charCode) => ret + charCode, 0) % BADGE_COLORS.length\n ] || BADGE_COLORS[0]\n );\n};\n\n/**\n * Generate a consistent color based on the input text.\n *\n * @param text - The input text to generate the color from.\n * @return A hexadecimal color string.\n */\nexport const colorText = (text: string): string => {\n const title = titleCase(text);\n\n return chalk.hex(getTextColor(title))(title);\n};\n\n/**\n * Generate a consistent color based on the input text.\n *\n * @param text - The input text to generate the color from.\n * @return A hexadecimal color string.\n */\nexport const colorBackground = (text: string): string => {\n const title = titleCase(text);\n\n return chalk.inverse.hex(getTextColor(title))(` ${title} `);\n};\n\n/**\n * Extend a logging function with a specific name, adding a colored badge to the log output.\n *\n * @param logFn - The original logging function to extend.\n * @param name - The name to use for the badge in the log output.\n * @returns A new logging function that includes the badge in its output.\n */\nexport const extendLog = (logFn: LogFn, name: string): LogFn => {\n return (type: LogLevelLabel, ...args: string[]) =>\n logFn(\n type,\n `${colorBackground(name)} ${args\n .filter(Boolean)\n .map(arg => String(arg).trim())\n .join(\" \")} `\n );\n};\n"],"mappings":";;;;;;;;;;;;;;;;;AA4CA,MAAa,aACX,MACA,UAA4B,EAAE,KACpB;CACV,MAAM,WACJ,QAAQ,aAAa,OACjB,cAAc,SACd,QAAQ,YAAY,cAAc;AACxC,KAAI,aAAa,cAAc,OAC7B,QAAO;AAGT,KAAI,QAAQ,aACV,QAAO,QAAQ;AAGjB,SAAQ,MAAqB,GAAG,SAC9B,SAAS,YAAY,KAAK,EAAE;EAC1B,GAAG;EACH;EACD,CAAC,CACA,GAAG,MAAM,KAAK,IACZ,SAAS,SAAS,QAA0C,CAC7D,CACC,GAAG,OAAO,UAAU,KAAK,GAAG,KAC1B,QAAQ,UAAU,MAAM,IAAI,KAAK,QAAQ,QAAQ,GAAG,GAAG,KACtD,OAAO,MAAM,KAAK,MAAM,GAAG,KAC5B,QAAQ,OAAO,GAAG,UAAU,QAAQ,KAAK,GAAG,MAAM,KAAK,MAAM,KAAK,KAElE,QAAQ,eAAe,QAAQ,4BAC3B,GAAG,UAAU,QAAQ,YAAY,GAAG,MAAM,KAAK,MAAM,KACrD,KAEP,GAAG,KAAK,KAAK,IAAI,CAAC,GAAG,MAAM,CAC7B;;AAGL,MAAM,eAAe;CACnB;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACD;;;;;;;AAQD,MAAa,gBAAgB,SAAyB;AACpD,QACE,aACE,KACG,MAAM,GAAG,CACT,KAAI,SAAQ,KAAK,WAAW,EAAE,CAAC,CAC/B,QAAQ,KAAK,aAAa,MAAM,UAAU,EAAE,GAAG,aAAa,WAC5D,aAAa;;;;;;;;AAUtB,MAAa,aAAa,SAAyB;CACjD,MAAM,QAAQ,UAAU,KAAK;AAE7B,QAAO,MAAM,IAAI,aAAa,MAAM,CAAC,CAAC,MAAM;;;;;;;;AAS9C,MAAa,mBAAmB,SAAyB;CACvD,MAAM,QAAQ,UAAU,KAAK;AAE7B,QAAO,MAAM,QAAQ,IAAI,aAAa,MAAM,CAAC,CAAC,IAAI,MAAM,GAAG;;;;;;;;;AAU7D,MAAa,aAAa,OAAc,SAAwB;AAC9D,SAAQ,MAAqB,GAAG,SAC9B,MACE,MACA,GAAG,gBAAgB,KAAK,CAAC,GAAG,KACzB,OAAO,QAAQ,CACf,KAAI,QAAO,OAAO,IAAI,CAAC,MAAM,CAAC,CAC9B,KAAK,IAAI,CAAC,GACd"}
|
|
@@ -53,7 +53,7 @@ function createUnplugin(context, options = {}) {
|
|
|
53
53
|
try {
|
|
54
54
|
const { resolveId, load } = require_lib_unplugin_module_resolution.createUnpluginModuleResolutionFunctions(context, options);
|
|
55
55
|
async function buildStart() {
|
|
56
|
-
log(_storm_software_config_tools_types.LogLevelLabel.DEBUG, "Powerlines build plugin starting...");
|
|
56
|
+
if (!options.silenceHookLogging) log(_storm_software_config_tools_types.LogLevelLabel.DEBUG, "Powerlines build plugin starting...");
|
|
57
57
|
await ctx.$$internal.callHook("buildStart", { sequential: true });
|
|
58
58
|
}
|
|
59
59
|
async function transform(code, id) {
|
|
@@ -65,11 +65,11 @@ function createUnplugin(context, options = {}) {
|
|
|
65
65
|
return transformed;
|
|
66
66
|
}
|
|
67
67
|
async function buildEnd() {
|
|
68
|
-
log(_storm_software_config_tools_types.LogLevelLabel.DEBUG, "Powerlines build plugin finishing...");
|
|
68
|
+
if (!options.silenceHookLogging) log(_storm_software_config_tools_types.LogLevelLabel.DEBUG, "Powerlines build plugin finishing...");
|
|
69
69
|
return ctx.$$internal.callHook("buildEnd", { sequential: true });
|
|
70
70
|
}
|
|
71
71
|
async function writeBundle() {
|
|
72
|
-
log(_storm_software_config_tools_types.LogLevelLabel.DEBUG, "Finalizing Powerlines project output...");
|
|
72
|
+
if (!options.silenceHookLogging) log(_storm_software_config_tools_types.LogLevelLabel.DEBUG, "Finalizing Powerlines project output...");
|
|
73
73
|
return ctx.$$internal.callHook("writeBundle", { sequential: true });
|
|
74
74
|
}
|
|
75
75
|
return {
|
|
@@ -21,7 +21,14 @@ interface CreateUnpluginResolverOptions extends CreateUnpluginModuleResolutionFu
|
|
|
21
21
|
* @returns The unplugin instance.
|
|
22
22
|
*/
|
|
23
23
|
declare function createUnpluginResolver<TContext extends PluginContext = PluginContext>(context: TContext, options?: CreateUnpluginResolverOptions): UnpluginFactory<TContext>;
|
|
24
|
-
interface CreateUnpluginOptions extends CreateUnpluginResolverOptions {
|
|
24
|
+
interface CreateUnpluginOptions extends CreateUnpluginResolverOptions {
|
|
25
|
+
/**
|
|
26
|
+
* Whether to silence logging for the plugin hooks. This can be useful for plugins that run frequently or have hooks that are called often, to reduce noise in the logs. When set to `true`, the plugin will not log any messages for its hooks. When set to `false` (the default), the plugin will log messages for its hooks as normal.
|
|
27
|
+
*
|
|
28
|
+
* @defaultValue false
|
|
29
|
+
*/
|
|
30
|
+
silenceHookLogging?: boolean;
|
|
31
|
+
}
|
|
25
32
|
/**
|
|
26
33
|
* Creates a Powerlines unplugin instance.
|
|
27
34
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plugin.d.cts","names":[],"sources":["../../../src/lib/unplugin/plugin.ts"],"mappings":";;;;;UAsCiB,6BAAA,SAAsC,8CAAA;;AAAvD;;;;;AAkBA;;EATE,IAAA;AAAA;;;;;;;iBASc,sBAAA,kBACG,aAAA,GAAgB,aAAA,CAAA,CAEjC,OAAA,EAAS,QAAA,EACT,OAAA,GAAS,6BAAA,GACR,eAAA,CAAgB,QAAA;AAAA,UA+BF,qBAAA,SAA8B,6BAAA
|
|
1
|
+
{"version":3,"file":"plugin.d.cts","names":[],"sources":["../../../src/lib/unplugin/plugin.ts"],"mappings":";;;;;UAsCiB,6BAAA,SAAsC,8CAAA;;AAAvD;;;;;AAkBA;;EATE,IAAA;AAAA;;;;;;;iBASc,sBAAA,kBACG,aAAA,GAAgB,aAAA,CAAA,CAEjC,OAAA,EAAS,QAAA,EACT,OAAA,GAAS,6BAAA,GACR,eAAA,CAAgB,QAAA;AAAA,UA+BF,qBAAA,SAA8B,6BAAA;EAnC5B;;;;;EAyCjB,kBAAA;AAAA;;;;AANF;;;iBAegB,cAAA,kBAAgC,aAAA,GAAgB,aAAA,CAAA,CAC9D,OAAA,EAAS,QAAA,EACT,OAAA,GAAS,qBAAA,GACR,eAAA,CAAgB,QAAA;AAAA"}
|
|
@@ -21,7 +21,14 @@ interface CreateUnpluginResolverOptions extends CreateUnpluginModuleResolutionFu
|
|
|
21
21
|
* @returns The unplugin instance.
|
|
22
22
|
*/
|
|
23
23
|
declare function createUnpluginResolver<TContext extends PluginContext = PluginContext>(context: TContext, options?: CreateUnpluginResolverOptions): UnpluginFactory<TContext>;
|
|
24
|
-
interface CreateUnpluginOptions extends CreateUnpluginResolverOptions {
|
|
24
|
+
interface CreateUnpluginOptions extends CreateUnpluginResolverOptions {
|
|
25
|
+
/**
|
|
26
|
+
* Whether to silence logging for the plugin hooks. This can be useful for plugins that run frequently or have hooks that are called often, to reduce noise in the logs. When set to `true`, the plugin will not log any messages for its hooks. When set to `false` (the default), the plugin will log messages for its hooks as normal.
|
|
27
|
+
*
|
|
28
|
+
* @defaultValue false
|
|
29
|
+
*/
|
|
30
|
+
silenceHookLogging?: boolean;
|
|
31
|
+
}
|
|
25
32
|
/**
|
|
26
33
|
* Creates a Powerlines unplugin instance.
|
|
27
34
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plugin.d.mts","names":[],"sources":["../../../src/lib/unplugin/plugin.ts"],"mappings":";;;;;UAsCiB,6BAAA,SAAsC,8CAAA;;AAAvD;;;;;AAkBA;;EATE,IAAA;AAAA;;;;;;;iBASc,sBAAA,kBACG,aAAA,GAAgB,aAAA,CAAA,CAEjC,OAAA,EAAS,QAAA,EACT,OAAA,GAAS,6BAAA,GACR,eAAA,CAAgB,QAAA;AAAA,UA+BF,qBAAA,SAA8B,6BAAA
|
|
1
|
+
{"version":3,"file":"plugin.d.mts","names":[],"sources":["../../../src/lib/unplugin/plugin.ts"],"mappings":";;;;;UAsCiB,6BAAA,SAAsC,8CAAA;;AAAvD;;;;;AAkBA;;EATE,IAAA;AAAA;;;;;;;iBASc,sBAAA,kBACG,aAAA,GAAgB,aAAA,CAAA,CAEjC,OAAA,EAAS,QAAA,EACT,OAAA,GAAS,6BAAA,GACR,eAAA,CAAgB,QAAA;AAAA,UA+BF,qBAAA,SAA8B,6BAAA;EAnC5B;;;;;EAyCjB,kBAAA;AAAA;;;;AANF;;;iBAegB,cAAA,kBAAgC,aAAA,GAAgB,aAAA,CAAA,CAC9D,OAAA,EAAS,QAAA,EACT,OAAA,GAAS,qBAAA,GACR,eAAA,CAAgB,QAAA;AAAA"}
|
|
@@ -51,7 +51,7 @@ function createUnplugin(context, options = {}) {
|
|
|
51
51
|
try {
|
|
52
52
|
const { resolveId, load } = createUnpluginModuleResolutionFunctions(context, options);
|
|
53
53
|
async function buildStart() {
|
|
54
|
-
log(LogLevelLabel.DEBUG, "Powerlines build plugin starting...");
|
|
54
|
+
if (!options.silenceHookLogging) log(LogLevelLabel.DEBUG, "Powerlines build plugin starting...");
|
|
55
55
|
await ctx.$$internal.callHook("buildStart", { sequential: true });
|
|
56
56
|
}
|
|
57
57
|
async function transform(code, id) {
|
|
@@ -63,11 +63,11 @@ function createUnplugin(context, options = {}) {
|
|
|
63
63
|
return transformed;
|
|
64
64
|
}
|
|
65
65
|
async function buildEnd() {
|
|
66
|
-
log(LogLevelLabel.DEBUG, "Powerlines build plugin finishing...");
|
|
66
|
+
if (!options.silenceHookLogging) log(LogLevelLabel.DEBUG, "Powerlines build plugin finishing...");
|
|
67
67
|
return ctx.$$internal.callHook("buildEnd", { sequential: true });
|
|
68
68
|
}
|
|
69
69
|
async function writeBundle() {
|
|
70
|
-
log(LogLevelLabel.DEBUG, "Finalizing Powerlines project output...");
|
|
70
|
+
if (!options.silenceHookLogging) log(LogLevelLabel.DEBUG, "Finalizing Powerlines project output...");
|
|
71
71
|
return ctx.$$internal.callHook("writeBundle", { sequential: true });
|
|
72
72
|
}
|
|
73
73
|
return {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plugin.mjs","names":[],"sources":["../../../src/lib/unplugin/plugin.ts"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Powerlines\n\n This code was released as part of the Powerlines project. Powerlines\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/powerlines.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/powerlines\n Documentation: https://docs.stormsoftware.com/projects/powerlines\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport { Unstable_PluginContext } from \"@powerlines/core/types/_internal\";\nimport { LogLevelLabel } from \"@storm-software/config-tools/types\";\nimport { kebabCase } from \"@stryke/string-format/kebab-case\";\nimport { titleCase } from \"@stryke/string-format/title-case\";\nimport type {\n TransformResult,\n UnpluginBuildContext,\n UnpluginContext\n} from \"unplugin\";\nimport { setParseImpl } from \"unplugin\";\nimport { PluginContext } from \"../../types/context\";\nimport { UnpluginFactory } from \"../../types/unplugin\";\nimport { extendLog } from \"../logger\";\nimport { getString } from \"../utilities/source-file\";\nimport { combineContexts } from \"./helpers\";\nimport {\n createUnpluginModuleResolutionFunctions,\n CreateUnpluginModuleResolutionFunctionsOptions\n} from \"./module-resolution\";\n\nexport interface CreateUnpluginResolverOptions extends CreateUnpluginModuleResolutionFunctionsOptions {\n /**\n * A name to use for the unplugin instance. This is used for logging and to generate the plugin name. It does not affect the functionality of the plugin.\n *\n * @remarks\n * If not provided, the plugin will be named \"powerlines\". If provided, the plugin will be named `${name} - Powerlines` (e.g., \"MyPlugin - Powerlines\").\n *\n * @defaultValue \"powerlines\"\n */\n name?: string;\n}\n\n/**\n * Creates a Powerlines unplugin instance.\n *\n * @param context - The plugin context.\n * @returns The unplugin instance.\n */\nexport function createUnpluginResolver<\n TContext extends PluginContext = PluginContext\n>(\n context: TContext,\n options: CreateUnpluginResolverOptions = {}\n): UnpluginFactory<TContext> {\n const ctx = context as unknown as Unstable_PluginContext;\n setParseImpl(ctx.parse);\n\n const name = options.name || \"powerlines\";\n\n return () => {\n const log = extendLog(ctx.log, name);\n log(LogLevelLabel.DEBUG, `Initializing ${titleCase(name)} plugin`);\n\n try {\n const { resolveId, load } =\n createUnpluginModuleResolutionFunctions<TContext>(context, options);\n\n return {\n name:\n name.toLowerCase() === \"powerlines\"\n ? \"powerlines\"\n : `powerlines:${kebabCase(name)}`,\n api: ctx.$$internal.api,\n resolveId,\n load\n };\n } catch (error) {\n log(LogLevelLabel.FATAL, (error as Error)?.message);\n\n throw error;\n }\n };\n}\n\nexport interface CreateUnpluginOptions extends CreateUnpluginResolverOptions {}\n\n/**\n * Creates a Powerlines unplugin instance.\n *\n * @param context - The plugin context.\n * @returns The unplugin instance.\n */\nexport function createUnplugin<TContext extends PluginContext = PluginContext>(\n context: TContext,\n options: CreateUnpluginOptions = {}\n): UnpluginFactory<TContext> {\n const ctx = context as unknown as Unstable_PluginContext;\n setParseImpl(ctx.parse);\n\n const name = options.name || \"powerlines\";\n\n return () => {\n const log = extendLog(ctx.log, name);\n log(LogLevelLabel.DEBUG, `Initializing ${titleCase(name)} plugin`);\n\n try {\n const { resolveId, load } =\n createUnpluginModuleResolutionFunctions<TContext>(context, options);\n\n async function buildStart(this: UnpluginBuildContext) {\n log(LogLevelLabel.DEBUG, \"Powerlines build plugin starting...\");\n\n await ctx.$$internal.callHook(\"buildStart\", {\n sequential: true\n });\n }\n\n async function transform(\n this: UnpluginBuildContext & UnpluginContext,\n code: string,\n id: string\n ): Promise<TransformResult | null | undefined> {\n let transformed: TransformResult | string = code;\n\n for (const hook of ctx.$$internal.environment.selectHooks(\n \"transform\"\n )) {\n const result: TransformResult | string | undefined =\n await hook.handler.apply(combineContexts(ctx, this), [\n getString(transformed),\n id\n ]);\n if (result) {\n transformed = result;\n }\n }\n\n return transformed;\n }\n\n async function buildEnd(this: UnpluginBuildContext): Promise<void> {\n log(LogLevelLabel.DEBUG, \"Powerlines build plugin finishing...\");\n\n return ctx.$$internal.callHook(\"buildEnd\", {\n sequential: true\n });\n }\n\n async function writeBundle(): Promise<void> {\n log(LogLevelLabel.DEBUG, \"Finalizing Powerlines project output...\");\n\n return ctx.$$internal.callHook(\"writeBundle\", {\n sequential: true\n });\n }\n\n return {\n name:\n name.toLowerCase() === \"powerlines\"\n ? \"powerlines\"\n : `powerlines:${kebabCase(name)}`,\n api: ctx.$$internal.api,\n resolveId,\n load,\n transform,\n buildStart,\n buildEnd,\n writeBundle,\n vite: {\n sharedDuringBuild: true\n }\n };\n } catch (error) {\n log(LogLevelLabel.FATAL, (error as Error)?.message);\n\n throw error;\n }\n };\n}\n"],"mappings":";;;;;;;;;;;;;;;;AAwDA,SAAgB,uBAGd,SACA,UAAyC,EAAE,EAChB;CAC3B,MAAM,MAAM;AACZ,cAAa,IAAI,MAAM;CAEvB,MAAM,OAAO,QAAQ,QAAQ;AAE7B,cAAa;EACX,MAAM,MAAM,UAAU,IAAI,KAAK,KAAK;AACpC,MAAI,cAAc,OAAO,gBAAgB,UAAU,KAAK,CAAC,SAAS;AAElE,MAAI;GACF,MAAM,EAAE,WAAW,SACjB,wCAAkD,SAAS,QAAQ;AAErE,UAAO;IACL,MACE,KAAK,aAAa,KAAK,eACnB,eACA,cAAc,UAAU,KAAK;IACnC,KAAK,IAAI,WAAW;IACpB;IACA;IACD;WACM,OAAO;AACd,OAAI,cAAc,OAAQ,OAAiB,QAAQ;AAEnD,SAAM;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"plugin.mjs","names":[],"sources":["../../../src/lib/unplugin/plugin.ts"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Powerlines\n\n This code was released as part of the Powerlines project. Powerlines\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/powerlines.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/powerlines\n Documentation: https://docs.stormsoftware.com/projects/powerlines\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport { Unstable_PluginContext } from \"@powerlines/core/types/_internal\";\nimport { LogLevelLabel } from \"@storm-software/config-tools/types\";\nimport { kebabCase } from \"@stryke/string-format/kebab-case\";\nimport { titleCase } from \"@stryke/string-format/title-case\";\nimport type {\n TransformResult,\n UnpluginBuildContext,\n UnpluginContext\n} from \"unplugin\";\nimport { setParseImpl } from \"unplugin\";\nimport { PluginContext } from \"../../types/context\";\nimport { UnpluginFactory } from \"../../types/unplugin\";\nimport { extendLog } from \"../logger\";\nimport { getString } from \"../utilities/source-file\";\nimport { combineContexts } from \"./helpers\";\nimport {\n createUnpluginModuleResolutionFunctions,\n CreateUnpluginModuleResolutionFunctionsOptions\n} from \"./module-resolution\";\n\nexport interface CreateUnpluginResolverOptions extends CreateUnpluginModuleResolutionFunctionsOptions {\n /**\n * A name to use for the unplugin instance. This is used for logging and to generate the plugin name. It does not affect the functionality of the plugin.\n *\n * @remarks\n * If not provided, the plugin will be named \"powerlines\". If provided, the plugin will be named `${name} - Powerlines` (e.g., \"MyPlugin - Powerlines\").\n *\n * @defaultValue \"powerlines\"\n */\n name?: string;\n}\n\n/**\n * Creates a Powerlines unplugin instance.\n *\n * @param context - The plugin context.\n * @returns The unplugin instance.\n */\nexport function createUnpluginResolver<\n TContext extends PluginContext = PluginContext\n>(\n context: TContext,\n options: CreateUnpluginResolverOptions = {}\n): UnpluginFactory<TContext> {\n const ctx = context as unknown as Unstable_PluginContext;\n setParseImpl(ctx.parse);\n\n const name = options.name || \"powerlines\";\n\n return () => {\n const log = extendLog(ctx.log, name);\n log(LogLevelLabel.DEBUG, `Initializing ${titleCase(name)} plugin`);\n\n try {\n const { resolveId, load } =\n createUnpluginModuleResolutionFunctions<TContext>(context, options);\n\n return {\n name:\n name.toLowerCase() === \"powerlines\"\n ? \"powerlines\"\n : `powerlines:${kebabCase(name)}`,\n api: ctx.$$internal.api,\n resolveId,\n load\n };\n } catch (error) {\n log(LogLevelLabel.FATAL, (error as Error)?.message);\n\n throw error;\n }\n };\n}\n\nexport interface CreateUnpluginOptions extends CreateUnpluginResolverOptions {\n /**\n * Whether to silence logging for the plugin hooks. This can be useful for plugins that run frequently or have hooks that are called often, to reduce noise in the logs. When set to `true`, the plugin will not log any messages for its hooks. When set to `false` (the default), the plugin will log messages for its hooks as normal.\n *\n * @defaultValue false\n */\n silenceHookLogging?: boolean;\n}\n\n/**\n * Creates a Powerlines unplugin instance.\n *\n * @param context - The plugin context.\n * @returns The unplugin instance.\n */\nexport function createUnplugin<TContext extends PluginContext = PluginContext>(\n context: TContext,\n options: CreateUnpluginOptions = {}\n): UnpluginFactory<TContext> {\n const ctx = context as unknown as Unstable_PluginContext;\n setParseImpl(ctx.parse);\n\n const name = options.name || \"powerlines\";\n\n return () => {\n const log = extendLog(ctx.log, name);\n log(LogLevelLabel.DEBUG, `Initializing ${titleCase(name)} plugin`);\n\n try {\n const { resolveId, load } =\n createUnpluginModuleResolutionFunctions<TContext>(context, options);\n\n async function buildStart(this: UnpluginBuildContext) {\n if (!options.silenceHookLogging) {\n log(LogLevelLabel.DEBUG, \"Powerlines build plugin starting...\");\n }\n\n await ctx.$$internal.callHook(\"buildStart\", {\n sequential: true\n });\n }\n\n async function transform(\n this: UnpluginBuildContext & UnpluginContext,\n code: string,\n id: string\n ): Promise<TransformResult | null | undefined> {\n let transformed: TransformResult | string = code;\n\n for (const hook of ctx.$$internal.environment.selectHooks(\n \"transform\"\n )) {\n const result: TransformResult | string | undefined =\n await hook.handler.apply(combineContexts(ctx, this), [\n getString(transformed),\n id\n ]);\n if (result) {\n transformed = result;\n }\n }\n\n return transformed;\n }\n\n async function buildEnd(this: UnpluginBuildContext): Promise<void> {\n if (!options.silenceHookLogging) {\n log(LogLevelLabel.DEBUG, \"Powerlines build plugin finishing...\");\n }\n\n return ctx.$$internal.callHook(\"buildEnd\", {\n sequential: true\n });\n }\n\n async function writeBundle(): Promise<void> {\n if (!options.silenceHookLogging) {\n log(LogLevelLabel.DEBUG, \"Finalizing Powerlines project output...\");\n }\n\n return ctx.$$internal.callHook(\"writeBundle\", {\n sequential: true\n });\n }\n\n return {\n name:\n name.toLowerCase() === \"powerlines\"\n ? \"powerlines\"\n : `powerlines:${kebabCase(name)}`,\n api: ctx.$$internal.api,\n resolveId,\n load,\n transform,\n buildStart,\n buildEnd,\n writeBundle,\n vite: {\n sharedDuringBuild: true\n }\n };\n } catch (error) {\n log(LogLevelLabel.FATAL, (error as Error)?.message);\n\n throw error;\n }\n };\n}\n"],"mappings":";;;;;;;;;;;;;;;;AAwDA,SAAgB,uBAGd,SACA,UAAyC,EAAE,EAChB;CAC3B,MAAM,MAAM;AACZ,cAAa,IAAI,MAAM;CAEvB,MAAM,OAAO,QAAQ,QAAQ;AAE7B,cAAa;EACX,MAAM,MAAM,UAAU,IAAI,KAAK,KAAK;AACpC,MAAI,cAAc,OAAO,gBAAgB,UAAU,KAAK,CAAC,SAAS;AAElE,MAAI;GACF,MAAM,EAAE,WAAW,SACjB,wCAAkD,SAAS,QAAQ;AAErE,UAAO;IACL,MACE,KAAK,aAAa,KAAK,eACnB,eACA,cAAc,UAAU,KAAK;IACnC,KAAK,IAAI,WAAW;IACpB;IACA;I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c,OAAQ,OAAiB,QAAQ;AAEnD,SAAM"}
|
|
@@ -13,7 +13,7 @@ let _stryke_type_checks_is_regexp = require("@stryke/type-checks/is-regexp");
|
|
|
13
13
|
* @returns The dependency configuration.
|
|
14
14
|
*/
|
|
15
15
|
function getDependencyConfig(context) {
|
|
16
|
-
const noExternal = (0, _stryke_helpers_get_unique.getUnique)((0, _stryke_convert_to_array.toArray)(context.config.resolve.noExternal).concat(context.builtins));
|
|
16
|
+
const noExternal = (0, _stryke_helpers_get_unique.getUnique)((0, _stryke_convert_to_array.toArray)(context.config.resolve.noExternal).concat(context.builtins.map((builtin) => `${context.config.framework}:${builtin}`)));
|
|
17
17
|
const external = (0, _stryke_helpers_get_unique.getUnique)((0, _stryke_convert_to_array.toArray)(context.config.resolve.external).reduce((ret, ext) => {
|
|
18
18
|
if ((0, _stryke_type_checks_is_regexp.isRegExp)(ext)) {
|
|
19
19
|
if (noExternal.some((noExt) => (0, _stryke_type_checks_is_regexp.isRegExp)(noExt) && noExt.source === ext.source)) return ret;
|
|
@@ -11,7 +11,7 @@ import { isRegExp } from "@stryke/type-checks/is-regexp";
|
|
|
11
11
|
* @returns The dependency configuration.
|
|
12
12
|
*/
|
|
13
13
|
function getDependencyConfig(context) {
|
|
14
|
-
const noExternal = getUnique(toArray(context.config.resolve.noExternal).concat(context.builtins));
|
|
14
|
+
const noExternal = getUnique(toArray(context.config.resolve.noExternal).concat(context.builtins.map((builtin) => `${context.config.framework}:${builtin}`)));
|
|
15
15
|
const external = getUnique(toArray(context.config.resolve.external).reduce((ret, ext) => {
|
|
16
16
|
if (isRegExp(ext)) {
|
|
17
17
|
if (noExternal.some((noExt) => isRegExp(noExt) && noExt.source === ext.source)) return ret;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"build-helpers.mjs","names":[],"sources":["../../src/plugin-utils/build-helpers.ts"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Powerlines\n\n This code was released as part of the Powerlines project. Powerlines\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/powerlines.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/powerlines\n Documentation: https://docs.stormsoftware.com/projects/powerlines\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport { toArray } from \"@stryke/convert/to-array\";\nimport { getUnique } from \"@stryke/helpers/get-unique\";\nimport { isRegExp } from \"@stryke/type-checks/is-regexp\";\nimport { isSetString } from \"@stryke/type-checks/is-set-string\";\nimport { ResolveConfig } from \"../types/config\";\nimport { Context } from \"../types/context\";\n\nexport interface GetDependencyConfigResult {\n external: ResolveConfig[\"external\"];\n noExternal: ResolveConfig[\"noExternal\"];\n}\n\n/**\n * Get the {@link ResolveConfig.external | external} and {@link ResolveConfig.noExternal | noExternal} dependencies for the build configuration.\n *\n * @param context - The build context.\n * @returns The dependency configuration.\n */\nexport function getDependencyConfig(\n context: Context\n): GetDependencyConfigResult {\n const noExternal = getUnique(\n toArray(context.config.resolve.noExternal).concat(context.builtins)\n );\n\n const external = getUnique(\n toArray(context.config.resolve.external).reduce(\n (ret, ext) => {\n if (isRegExp(ext)) {\n if (\n noExternal.some(\n noExt => isRegExp(noExt) && noExt.source === ext.source\n )\n ) {\n return ret;\n }\n\n const noExts = noExternal.filter(\n noExt => isSetString(noExt) && ext.test(noExt)\n );\n if (noExts.length > 0) {\n ret.push(\n new RegExp(\n noExts.reduce(\n (regex: string, noExt: string | RegExp) =>\n `(?!${\n isRegExp(noExt) ? noExt.source : `^${noExt}$`\n })${regex}`,\n `${ext.source\n .replace(/^\\^@\\?/, \"^@\")\n .replace(/^@\\?/, \"@\")\n .replace(/\\$$/, \"\")\n .replace(/\\.\\*$/, \"\")}.*$`\n )\n )\n );\n return ret;\n }\n }\n\n ret.push(ext);\n return ret;\n },\n [] as (string | RegExp)[]\n )\n );\n\n return {\n external: external.length === 0 ? undefined : external,\n noExternal: noExternal.length === 0 ? undefined : noExternal\n };\n}\n"],"mappings":";;;;;;;;;;;;AAoCA,SAAgB,oBACd,SAC2B;CAC3B,MAAM,aAAa,UACjB,QAAQ,QAAQ,OAAO,QAAQ,WAAW,CAAC,
|
|
1
|
+
{"version":3,"file":"build-helpers.mjs","names":[],"sources":["../../src/plugin-utils/build-helpers.ts"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Powerlines\n\n This code was released as part of the Powerlines project. Powerlines\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/powerlines.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/powerlines\n Documentation: https://docs.stormsoftware.com/projects/powerlines\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport { toArray } from \"@stryke/convert/to-array\";\nimport { getUnique } from \"@stryke/helpers/get-unique\";\nimport { isRegExp } from \"@stryke/type-checks/is-regexp\";\nimport { isSetString } from \"@stryke/type-checks/is-set-string\";\nimport { ResolveConfig } from \"../types/config\";\nimport { Context } from \"../types/context\";\n\nexport interface GetDependencyConfigResult {\n external: ResolveConfig[\"external\"];\n noExternal: ResolveConfig[\"noExternal\"];\n}\n\n/**\n * Get the {@link ResolveConfig.external | external} and {@link ResolveConfig.noExternal | noExternal} dependencies for the build configuration.\n *\n * @param context - The build context.\n * @returns The dependency configuration.\n */\nexport function getDependencyConfig(\n context: Context\n): GetDependencyConfigResult {\n const noExternal = getUnique(\n toArray(context.config.resolve.noExternal).concat(\n context.builtins.map(builtin => `${context.config.framework}:${builtin}`)\n )\n );\n\n const external = getUnique(\n toArray(context.config.resolve.external).reduce(\n (ret, ext) => {\n if (isRegExp(ext)) {\n if (\n noExternal.some(\n noExt => isRegExp(noExt) && noExt.source === ext.source\n )\n ) {\n return ret;\n }\n\n const noExts = noExternal.filter(\n noExt => isSetString(noExt) && ext.test(noExt)\n );\n if (noExts.length > 0) {\n ret.push(\n new RegExp(\n noExts.reduce(\n (regex: string, noExt: string | RegExp) =>\n `(?!${\n isRegExp(noExt) ? noExt.source : `^${noExt}$`\n })${regex}`,\n `${ext.source\n .replace(/^\\^@\\?/, \"^@\")\n .replace(/^@\\?/, \"@\")\n .replace(/\\$$/, \"\")\n .replace(/\\.\\*$/, \"\")}.*$`\n )\n )\n );\n return ret;\n }\n }\n\n ret.push(ext);\n return ret;\n },\n [] as (string | RegExp)[]\n )\n );\n\n return {\n external: external.length === 0 ? undefined : external,\n noExternal: noExternal.length === 0 ? undefined : noExternal\n };\n}\n"],"mappings":";;;;;;;;;;;;AAoCA,SAAgB,oBACd,SAC2B;CAC3B,MAAM,aAAa,UACjB,QAAQ,QAAQ,OAAO,QAAQ,WAAW,CAAC,OACzC,QAAQ,SAAS,KAAI,YAAW,GAAG,QAAQ,OAAO,UAAU,GAAG,UAAU,CAC1E,CACF;CAED,MAAM,WAAW,UACf,QAAQ,QAAQ,OAAO,QAAQ,SAAS,CAAC,QACtC,KAAK,QAAQ;AACZ,MAAI,SAAS,IAAI,EAAE;AACjB,OACE,WAAW,MACT,UAAS,SAAS,MAAM,IAAI,MAAM,WAAW,IAAI,OAClD,CAED,QAAO;GAGT,MAAM,SAAS,WAAW,QACxB,UAAS,YAAY,MAAM,IAAI,IAAI,KAAK,MAAM,CAC/C;AACD,OAAI,OAAO,SAAS,GAAG;AACrB,QAAI,KACF,IAAI,OACF,OAAO,QACJ,OAAe,UACd,MACE,SAAS,MAAM,GAAG,MAAM,SAAS,IAAI,MAAM,GAC5C,GAAG,SACN,GAAG,IAAI,OACJ,QAAQ,UAAU,KAAK,CACvB,QAAQ,QAAQ,IAAI,CACpB,QAAQ,OAAO,GAAG,CAClB,QAAQ,SAAS,GAAG,CAAC,KACzB,CACF,CACF;AACD,WAAO;;;AAIX,MAAI,KAAK,IAAI;AACb,SAAO;IAET,EAAE,CACH,CACF;AAED,QAAO;EACL,UAAU,SAAS,WAAW,IAAI,SAAY;EAC9C,YAAY,WAAW,WAAW,IAAI,SAAY;EACnD"}
|
|
@@ -4,6 +4,7 @@ const require_plugin = require('../constants/plugin.cjs');
|
|
|
4
4
|
let _stryke_type_checks_is_function = require("@stryke/type-checks/is-function");
|
|
5
5
|
let _stryke_type_checks_is_set_object = require("@stryke/type-checks/is-set-object");
|
|
6
6
|
let _stryke_type_checks_is_set_string = require("@stryke/type-checks/is-set-string");
|
|
7
|
+
let _stryke_string_format_kebab_case = require("@stryke/string-format/kebab-case");
|
|
7
8
|
let _stryke_type_checks_is_undefined = require("@stryke/type-checks/is-undefined");
|
|
8
9
|
|
|
9
10
|
//#region src/plugin-utils/helpers.ts
|
|
@@ -126,8 +127,20 @@ function isUnpluginHookField(field) {
|
|
|
126
127
|
* @param plugins - The list of plugins to check against
|
|
127
128
|
* @returns True if the plugin should be deduplicated, false otherwise
|
|
128
129
|
*/
|
|
129
|
-
function
|
|
130
|
-
return plugin.dedupe
|
|
130
|
+
function isDuplicate(plugin, plugins) {
|
|
131
|
+
return plugin.dedupe !== false && plugins.some((p) => p.dedupe !== false && ((0, _stryke_type_checks_is_function.isFunction)(p.dedupe) && p.dedupe(plugin) || (0, _stryke_string_format_kebab_case.kebabCase)(p.name) === (0, _stryke_string_format_kebab_case.kebabCase)(plugin.name)));
|
|
132
|
+
}
|
|
133
|
+
/**
|
|
134
|
+
* Remove duplicate hooks from a list of hooks, keeping the first occurrence of each plugin.
|
|
135
|
+
*
|
|
136
|
+
* @param hooksList - The list of hooks to deduplicate.
|
|
137
|
+
* @returns A new list of hooks with duplicates removed.
|
|
138
|
+
*/
|
|
139
|
+
function dedupeHooklist(hooksList) {
|
|
140
|
+
return hooksList.reduce((ret, hook) => {
|
|
141
|
+
if (!isDuplicate(hook.plugin, ret.map((h) => h.plugin))) ret.push(hook);
|
|
142
|
+
return ret;
|
|
143
|
+
}, []);
|
|
131
144
|
}
|
|
132
145
|
/**
|
|
133
146
|
* Add a plugin hook to the hooks list.
|
|
@@ -138,14 +151,15 @@ function checkDedupe(plugin, plugins) {
|
|
|
138
151
|
* @param hooksList - The list of hooks to add to
|
|
139
152
|
*/
|
|
140
153
|
function addPluginHook(context, plugin, pluginHook, hooksList) {
|
|
141
|
-
if (!
|
|
154
|
+
if (!isDuplicate(plugin, hooksList.map((hook) => hook.plugin).filter(Boolean))) {
|
|
142
155
|
const handler = ((...args) => getHookHandler(pluginHook).apply(context, args));
|
|
143
|
-
if (!handler) return;
|
|
156
|
+
if (!handler) return hooksList;
|
|
144
157
|
hooksList.push({
|
|
145
158
|
plugin,
|
|
146
159
|
handler
|
|
147
160
|
});
|
|
148
161
|
}
|
|
162
|
+
return hooksList;
|
|
149
163
|
}
|
|
150
164
|
/**
|
|
151
165
|
* Check the provided {@link PluginConfig}, and return a stringified version of the invalid configuration. If an array is provided, check each item in the array.
|
|
@@ -168,10 +182,11 @@ function findInvalidPluginConfig(config) {
|
|
|
168
182
|
|
|
169
183
|
//#endregion
|
|
170
184
|
exports.addPluginHook = addPluginHook;
|
|
171
|
-
exports.
|
|
185
|
+
exports.dedupeHooklist = dedupeHooklist;
|
|
172
186
|
exports.extractPluginHook = extractPluginHook;
|
|
173
187
|
exports.findInvalidPluginConfig = findInvalidPluginConfig;
|
|
174
188
|
exports.getHookHandler = getHookHandler;
|
|
189
|
+
exports.isDuplicate = isDuplicate;
|
|
175
190
|
exports.isPlugin = isPlugin;
|
|
176
191
|
exports.isPluginConfig = isPluginConfig;
|
|
177
192
|
exports.isPluginConfigObject = isPluginConfigObject;
|
|
@@ -120,7 +120,14 @@ declare function isUnpluginHookField<TUnpluginBuilderVariant extends UnpluginBui
|
|
|
120
120
|
* @param plugins - The list of plugins to check against
|
|
121
121
|
* @returns True if the plugin should be deduplicated, false otherwise
|
|
122
122
|
*/
|
|
123
|
-
declare function
|
|
123
|
+
declare function isDuplicate<TResolvedConfig extends ResolvedConfig = ResolvedConfig, TContext extends PluginContext<TResolvedConfig> = PluginContext<TResolvedConfig>>(plugin: Plugin<TContext>, plugins: Plugin<TContext>[]): boolean;
|
|
124
|
+
/**
|
|
125
|
+
* Remove duplicate hooks from a list of hooks, keeping the first occurrence of each plugin.
|
|
126
|
+
*
|
|
127
|
+
* @param hooksList - The list of hooks to deduplicate.
|
|
128
|
+
* @returns A new list of hooks with duplicates removed.
|
|
129
|
+
*/
|
|
130
|
+
declare function dedupeHooklist<TContext extends PluginContext = PluginContext, TField extends PluginHookFields<TContext> = PluginHookFields<TContext>, TList extends HooksListItem<TContext, TField> = HooksListItem<TContext, TField>>(hooksList: TList[]): TList[];
|
|
124
131
|
/**
|
|
125
132
|
* Add a plugin hook to the hooks list.
|
|
126
133
|
*
|
|
@@ -129,7 +136,7 @@ declare function checkDedupe<TResolvedConfig extends ResolvedConfig = ResolvedCo
|
|
|
129
136
|
* @param pluginHook - The plugin hook to add
|
|
130
137
|
* @param hooksList - The list of hooks to add to
|
|
131
138
|
*/
|
|
132
|
-
declare function addPluginHook<TContext extends PluginContext = PluginContext, TField extends PluginHookFields<TContext> = PluginHookFields<TContext>, TList extends HooksListItem<TContext, TField> = HooksListItem<TContext, TField>>(context: TContext, plugin: Plugin<TContext>, pluginHook: PluginHook<AnyFunction>, hooksList: TList[]):
|
|
139
|
+
declare function addPluginHook<TContext extends PluginContext = PluginContext, TField extends PluginHookFields<TContext> = PluginHookFields<TContext>, TList extends HooksListItem<TContext, TField> = HooksListItem<TContext, TField>>(context: TContext, plugin: Plugin<TContext>, pluginHook: PluginHook<AnyFunction>, hooksList: TList[]): TList[];
|
|
133
140
|
/**
|
|
134
141
|
* Check the provided {@link PluginConfig}, and return a stringified version of the invalid configuration. If an array is provided, check each item in the array.
|
|
135
142
|
*
|
|
@@ -139,5 +146,5 @@ declare function addPluginHook<TContext extends PluginContext = PluginContext, T
|
|
|
139
146
|
declare function findInvalidPluginConfig<TContext extends PluginContext = PluginContext<ResolvedConfig>>(config: PluginConfig<TContext>): string[] | null;
|
|
140
147
|
declare type __ΩGetHookHandlerReturnType = any[];
|
|
141
148
|
//#endregion
|
|
142
|
-
export { GetHookHandlerReturnType, __ΩGetHookHandlerReturnType, addPluginHook,
|
|
149
|
+
export { GetHookHandlerReturnType, __ΩGetHookHandlerReturnType, addPluginHook, dedupeHooklist, extractPluginHook, findInvalidPluginConfig, getHookHandler, isDuplicate, isPlugin, isPluginConfig, isPluginConfigObject, isPluginConfigTuple, isPluginHook, isPluginHookField, isPluginHookFunction, isPluginHookObject, isUnpluginHookField, isUnpluginHookKey };
|
|
143
150
|
//# sourceMappingURL=helpers.d.cts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"helpers.d.cts","names":[],"sources":["../../src/plugin-utils/helpers.ts"],"mappings":";;;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"helpers.d.cts","names":[],"sources":["../../src/plugin-utils/helpers.ts"],"mappings":";;;;;;;;;;;;;;;;;iBAuDgB,QAAA,kBACG,aAAA,GAAgB,aAAA,CAAc,cAAA,EAAA,CAC/C,KAAA,YAAiB,KAAA,IAAS,MAAA,CAAO,QAAA;;;;;;;iBA6BnB,oBAAA,kBACG,aAAA,GAAgB,aAAA,CAAc,cAAA,EAAA,CAC/C,KAAA,YAAiB,KAAA,IAAS,kBAAA,CAAmB,QAAA;;;;;;;iBAiB/B,mBAAA,kBACG,aAAA,GAAgB,aAAA,CAAc,cAAA,EAAA,CAC/C,KAAA,YAAiB,KAAA,IAAS,iBAAA,CAAkB,QAAA;;;;;;AArB9C;iBAsCgB,cAAA,kBACG,aAAA,GAAgB,aAAA,CAAc,cAAA,EAAA,CAC/C,KAAA,YAAiB,KAAA,IAAS,YAAA,CAAa,QAAA;;;;;;;iBAiBzB,kBAAA,CACd,KAAA,YACC,KAAA,IAAS,gBAAA,CAAiB,WAAA;;;;;;;iBAUb,oBAAA,CAAqB,KAAA,YAAiB,KAAA,IAAS,WAAA;;;;;AAlD/D;;iBA4DgB,YAAA,CAA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AA,EAAA,CAEF,SAAA,EAAW,KAAA,KAAU,KAAA;;;;;;;;;iBAsBP,aAAA,kBACG,aAAA,GAAgB,aAAA,iBAClB,gBAAA,CAAiB,QAAA,IAAY,gBAAA,CAAiB,QAAA,iBAC/C,aAAA,CAAc,QAAA,EAAU,MAAA,IAAU,aAAA,CAC9C,QAAA,EACA,MAAA,EAAA,CAGF,OAAA,EAAS,QAAA,EACT,MAAA,EAAQ,MAAA,CAAO,QAAA,GACf,UAAA,EAAY,UAAA,CAAW,WAAA,GACvB,SAAA,EAAW,KAAA,KACV,KAAA;;;;;;;iBA6Ba,uBAAA,kBACG,aAAA,GAAgB,aAAA,CAAc,cAAA,EAAA,CAC/C,MAAA,EAAQ,YAAA,CAAa,QAAA;AAAA"}
|
|
@@ -120,7 +120,14 @@ declare function isUnpluginHookField<TUnpluginBuilderVariant extends UnpluginBui
|
|
|
120
120
|
* @param plugins - The list of plugins to check against
|
|
121
121
|
* @returns True if the plugin should be deduplicated, false otherwise
|
|
122
122
|
*/
|
|
123
|
-
declare function
|
|
123
|
+
declare function isDuplicate<TResolvedConfig extends ResolvedConfig = ResolvedConfig, TContext extends PluginContext<TResolvedConfig> = PluginContext<TResolvedConfig>>(plugin: Plugin<TContext>, plugins: Plugin<TContext>[]): boolean;
|
|
124
|
+
/**
|
|
125
|
+
* Remove duplicate hooks from a list of hooks, keeping the first occurrence of each plugin.
|
|
126
|
+
*
|
|
127
|
+
* @param hooksList - The list of hooks to deduplicate.
|
|
128
|
+
* @returns A new list of hooks with duplicates removed.
|
|
129
|
+
*/
|
|
130
|
+
declare function dedupeHooklist<TContext extends PluginContext = PluginContext, TField extends PluginHookFields<TContext> = PluginHookFields<TContext>, TList extends HooksListItem<TContext, TField> = HooksListItem<TContext, TField>>(hooksList: TList[]): TList[];
|
|
124
131
|
/**
|
|
125
132
|
* Add a plugin hook to the hooks list.
|
|
126
133
|
*
|
|
@@ -129,7 +136,7 @@ declare function checkDedupe<TResolvedConfig extends ResolvedConfig = ResolvedCo
|
|
|
129
136
|
* @param pluginHook - The plugin hook to add
|
|
130
137
|
* @param hooksList - The list of hooks to add to
|
|
131
138
|
*/
|
|
132
|
-
declare function addPluginHook<TContext extends PluginContext = PluginContext, TField extends PluginHookFields<TContext> = PluginHookFields<TContext>, TList extends HooksListItem<TContext, TField> = HooksListItem<TContext, TField>>(context: TContext, plugin: Plugin<TContext>, pluginHook: PluginHook<AnyFunction>, hooksList: TList[]):
|
|
139
|
+
declare function addPluginHook<TContext extends PluginContext = PluginContext, TField extends PluginHookFields<TContext> = PluginHookFields<TContext>, TList extends HooksListItem<TContext, TField> = HooksListItem<TContext, TField>>(context: TContext, plugin: Plugin<TContext>, pluginHook: PluginHook<AnyFunction>, hooksList: TList[]): TList[];
|
|
133
140
|
/**
|
|
134
141
|
* Check the provided {@link PluginConfig}, and return a stringified version of the invalid configuration. If an array is provided, check each item in the array.
|
|
135
142
|
*
|
|
@@ -139,5 +146,5 @@ declare function addPluginHook<TContext extends PluginContext = PluginContext, T
|
|
|
139
146
|
declare function findInvalidPluginConfig<TContext extends PluginContext = PluginContext<ResolvedConfig>>(config: PluginConfig<TContext>): string[] | null;
|
|
140
147
|
declare type __ΩGetHookHandlerReturnType = any[];
|
|
141
148
|
//#endregion
|
|
142
|
-
export { GetHookHandlerReturnType, __ΩGetHookHandlerReturnType, addPluginHook,
|
|
149
|
+
export { GetHookHandlerReturnType, __ΩGetHookHandlerReturnType, addPluginHook, dedupeHooklist, extractPluginHook, findInvalidPluginConfig, getHookHandler, isDuplicate, isPlugin, isPluginConfig, isPluginConfigObject, isPluginConfigTuple, isPluginHook, isPluginHookField, isPluginHookFunction, isPluginHookObject, isUnpluginHookField, isUnpluginHookKey };
|
|
143
150
|
//# sourceMappingURL=helpers.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"helpers.d.mts","names":[],"sources":["../../src/plugin-utils/helpers.ts"],"mappings":";;;;;;;;;;;;;;;;;
|
|
1
|
+
{"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KS_FIELDS, PLUGIN_NON_HOOK_FIELDS, UNPLUGIN_BUILDER_VARIANTS
|
|
|
2
2
|
import { isFunction } from "@stryke/type-checks/is-function";
|
|
3
3
|
import { isSetObject } from "@stryke/type-checks/is-set-object";
|
|
4
4
|
import { isSetString } from "@stryke/type-checks/is-set-string";
|
|
5
|
+
import { kebabCase } from "@stryke/string-format/kebab-case";
|
|
5
6
|
import { isUndefined } from "@stryke/type-checks/is-undefined";
|
|
6
7
|
|
|
7
8
|
//#region src/plugin-utils/helpers.ts
|
|
@@ -124,8 +125,20 @@ function isUnpluginHookField(field) {
|
|
|
124
125
|
* @param plugins - The list of plugins to check against
|
|
125
126
|
* @returns True if the plugin should be deduplicated, false otherwise
|
|
126
127
|
*/
|
|
127
|
-
function
|
|
128
|
-
return plugin.dedupe
|
|
128
|
+
function isDuplicate(plugin, plugins) {
|
|
129
|
+
return plugin.dedupe !== false && plugins.some((p) => p.dedupe !== false && (isFunction(p.dedupe) && p.dedupe(plugin) || kebabCase(p.name) === kebabCase(plugin.name)));
|
|
130
|
+
}
|
|
131
|
+
/**
|
|
132
|
+
* Remove duplicate hooks from a list of hooks, keeping the first occurrence of each plugin.
|
|
133
|
+
*
|
|
134
|
+
* @param hooksList - The list of hooks to deduplicate.
|
|
135
|
+
* @returns A new list of hooks with duplicates removed.
|
|
136
|
+
*/
|
|
137
|
+
function dedupeHooklist(hooksList) {
|
|
138
|
+
return hooksList.reduce((ret, hook) => {
|
|
139
|
+
if (!isDuplicate(hook.plugin, ret.map((h) => h.plugin))) ret.push(hook);
|
|
140
|
+
return ret;
|
|
141
|
+
}, []);
|
|
129
142
|
}
|
|
130
143
|
/**
|
|
131
144
|
* Add a plugin hook to the hooks list.
|
|
@@ -136,14 +149,15 @@ function checkDedupe(plugin, plugins) {
|
|
|
136
149
|
* @param hooksList - The list of hooks to add to
|
|
137
150
|
*/
|
|
138
151
|
function addPluginHook(context, plugin, pluginHook, hooksList) {
|
|
139
|
-
if (!
|
|
152
|
+
if (!isDuplicate(plugin, hooksList.map((hook) => hook.plugin).filter(Boolean))) {
|
|
140
153
|
const handler = ((...args) => getHookHandler(pluginHook).apply(context, args));
|
|
141
|
-
if (!handler) return;
|
|
154
|
+
if (!handler) return hooksList;
|
|
142
155
|
hooksList.push({
|
|
143
156
|
plugin,
|
|
144
157
|
handler
|
|
145
158
|
});
|
|
146
159
|
}
|
|
160
|
+
return hooksList;
|
|
147
161
|
}
|
|
148
162
|
/**
|
|
149
163
|
* Check the provided {@link PluginConfig}, and return a stringified version of the invalid configuration. If an array is provided, check each item in the array.
|
|
@@ -165,5 +179,5 @@ function findInvalidPluginConfig(config) {
|
|
|
165
179
|
}
|
|
166
180
|
|
|
167
181
|
//#endregion
|
|
168
|
-
export { addPluginHook,
|
|
182
|
+
export { addPluginHook, dedupeHooklist, extractPluginHook, findInvalidPluginConfig, getHookHandler, isDuplicate, isPlugin, isPluginConfig, isPluginConfigObject, isPluginConfigTuple, isPluginHook, isPluginHookField, isPluginHookFunction, isPluginHookObject, isUnpluginHookField, isUnpluginHookKey };
|
|
169
183
|
//# sourceMappingURL=helpers.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"helpers.mjs","names":[],"sources":["../../src/plugin-utils/helpers.ts"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Powerlines\n\n This code was released as part of the Powerlines project. Powerlines\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/powerlines.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/powerlines\n Documentation: https://docs.stormsoftware.com/projects/powerlines\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport { isFunction } from \"@stryke/type-checks/is-function\";\nimport { isSetObject } from \"@stryke/type-checks/is-set-object\";\nimport { isSetString } from \"@stryke/type-checks/is-set-string\";\nimport { isUndefined } from \"@stryke/type-checks/is-undefined\";\nimport { AnyFunction } from \"@stryke/types/base\";\nimport {\n PLUGIN_HOOKS_FIELDS,\n PLUGIN_NON_HOOK_FIELDS,\n UNPLUGIN_BUILDER_VARIANTS\n} from \"../constants/plugin\";\nimport type {\n PluginConfig,\n PluginConfigObject,\n PluginConfigTuple,\n ResolvedConfig\n} from \"../types/config\";\nimport type { PluginContext, WithUnpluginBuildContext } from \"../types/context\";\nimport type { HooksListItem } from \"../types/hooks\";\nimport type {\n Plugin,\n PluginHook,\n PluginHookFields,\n PluginHookObject,\n PluginHooks\n} from \"../types/plugin\";\nimport type {\n UnpluginBuilderVariant,\n UnpluginOptions\n} from \"../types/unplugin\";\n\n/**\n * Type guard to check if an object is a {@link Plugin}\n *\n * @param value - The object to check\n * @returns True if the object is a {@link Plugin}, false otherwise\n */\nexport function isPlugin<\n TContext extends PluginContext = PluginContext<ResolvedConfig>\n>(value: unknown): value is Plugin<TContext> {\n return (\n isSetObject(value) &&\n \"name\" in value &&\n isSetString(value.name) &&\n (isUndefined((value as Plugin<TContext>).api) ||\n (\"api\" in value && isSetObject(value.api))) &&\n (isUndefined((value as Plugin<TContext>).applyToEnvironment) ||\n (\"applyToEnvironment\" in value &&\n isFunction(value.applyToEnvironment))) &&\n (isUndefined((value as Plugin<TContext>).dedupe) ||\n (\"dedupe\" in value && isFunction(value.dedupe))) &&\n PLUGIN_HOOKS_FIELDS.every(\n hook =>\n isUndefined((value as Plugin<TContext>)[hook]) ||\n (hook in value &&\n (isPluginHookFunction((value as Plugin<TContext>)[hook]) ||\n (hook === \"config\" &&\n isSetObject((value as Plugin<TContext>)[hook]))))\n )\n );\n}\n\n/**\n * Type guard to check if an object is a {@link PluginConfigObject}\n *\n * @param value - The object to check\n * @returns True if the object is a {@link PluginConfigObject}, false otherwise\n */\nexport function isPluginConfigObject<\n TContext extends PluginContext = PluginContext<ResolvedConfig>\n>(value: unknown): value is PluginConfigObject<TContext> {\n return (\n isSetObject(value) &&\n \"plugin\" in value &&\n (((isSetString(value.plugin) || isFunction(value.plugin)) &&\n \"options\" in value &&\n isSetObject(value.options)) ||\n isPlugin(value.plugin))\n );\n}\n\n/**\n * Type guard to check if an object is a {@link PluginConfigTuple}\n *\n * @param value - The object to check\n * @returns True if the object is a {@link PluginConfigTuple}, false otherwise\n */\nexport function isPluginConfigTuple<\n TContext extends PluginContext = PluginContext<ResolvedConfig>\n>(value: unknown): value is PluginConfigTuple<TContext> {\n return (\n Array.isArray(value) &&\n (value.length === 1 || value.length === 2) &&\n (((isSetString(value[0]) || isFunction(value[0])) &&\n value.length > 1 &&\n isSetObject(value[1])) ||\n isPlugin(value[0]))\n );\n}\n\n/**\n * Type guard to check if an object is a {@link PluginConfig}\n *\n * @param value - The object to check\n * @returns True if the object is a {@link PluginConfig}, false otherwise\n */\nexport function isPluginConfig<\n TContext extends PluginContext = PluginContext<ResolvedConfig>\n>(value: unknown): value is PluginConfig<TContext> {\n return (\n isSetString(value) ||\n isFunction(value) ||\n isPlugin<TContext>(value) ||\n isPluginConfigObject(value) ||\n isPluginConfigTuple(value) ||\n (Array.isArray(value) && value.every(item => isPluginConfig(item)))\n );\n}\n\n/**\n * Type guard to check if an value is a {@link PluginHook} function\n *\n * @param value - The value to check\n * @returns True if the value is a {@link PluginHook} function, false otherwise\n */\nexport function isPluginHookObject(\n value: unknown\n): value is PluginHookObject<AnyFunction> {\n return isSetObject(value) && \"handler\" in value && isFunction(value.handler);\n}\n\n/**\n * Type guard to check if an value is a {@link PluginHook} function\n *\n * @param value - The value to check\n * @returns True if the value is a {@link PluginHook} function, false otherwise\n */\nexport function isPluginHookFunction(value: unknown): value is AnyFunction {\n return isFunction(value) || isPluginHookObject(value);\n}\n\n/**\n * Type guard to check if an object is a {@link PluginHook}\n *\n * @param value - The object to check\n * @returns True if the object is a {@link PluginHook}, false otherwise\n */\nexport function isPluginHook(value: unknown): value is PluginHook<AnyFunction> {\n return isPluginHookFunction(value) || isPluginHookObject(value);\n}\n\nexport type GetHookHandlerReturnType<\n TContext extends PluginContext = PluginContext,\n TField extends string = string\n> = HooksListItem<TContext, TField>[\"handler\"];\n\n/**\n * Extract the hook handler function from a plugin hook\n *\n * @param pluginHook - The plugin hook to extract the handler function from\n * @returns The hook handler function\n */\nexport function getHookHandler<\n TContext extends PluginContext = PluginContext,\n TKey extends string = string\n>(\n pluginHook: PluginHook<AnyFunction>\n): GetHookHandlerReturnType<TContext, TKey> {\n return (\n isFunction(pluginHook) ? pluginHook : pluginHook.handler\n ) as GetHookHandlerReturnType<TContext, TKey>;\n}\n\n/**\n * Extract a plugin hook from a plugin\n *\n * @param context - The build context\n * @param plugin - The plugin to extract the hook from\n * @param hook - The name of the hook to extract\n * @returns The extracted hook, or undefined if the hook does not exist\n */\nexport function extractPluginHook<\n TContext extends PluginContext = PluginContext,\n TPlugin extends Plugin<TContext> = Plugin<TContext>\n>(context: TContext, plugin: TPlugin, hook: keyof PluginHooks<TContext>) {\n const pluginHook = plugin[hook];\n if (!isPluginHook(pluginHook)) {\n return undefined;\n }\n\n return isFunction(pluginHook)\n ? {\n normal: pluginHook.bind(context)\n }\n : {\n [pluginHook.order ? pluginHook.order : \"normal\"]:\n pluginHook.handler.bind(context)\n };\n}\n\n/**\n * Check if a hook is external.\n *\n * @param keys - The name of the hook to check.\n * @returns True if the hook is external, false otherwise.\n */\nexport function isUnpluginHookKey<\n TUnpluginBuilderVariant extends UnpluginBuilderVariant =\n UnpluginBuilderVariant\n>(\n keys: string\n): keys is `${TUnpluginBuilderVariant}:${keyof UnpluginOptions[TUnpluginBuilderVariant] & string}` {\n return UNPLUGIN_BUILDER_VARIANTS.some(variant =>\n keys.startsWith(`${variant}:`)\n );\n}\n\n/**\n * Check if a hook is internal.\n *\n * @param keys - The name of the hook to check.\n * @returns True if the hook is external, false otherwise.\n */\nexport function isPluginHookField<TContext extends PluginContext>(\n keys: string\n) {\n return !PLUGIN_NON_HOOK_FIELDS.includes(keys as PluginHookFields<TContext>);\n}\n\n/**\n * Check if a hook is external.\n *\n * @param field - The name of the hook to check.\n * @returns True if the hook is external, false otherwise.\n */\nexport function isUnpluginHookField<\n TUnpluginBuilderVariant extends UnpluginBuilderVariant =\n UnpluginBuilderVariant\n>(field: string): field is TUnpluginBuilderVariant {\n return (\n !isPluginHookField(field) &&\n UNPLUGIN_BUILDER_VARIANTS.includes(field as UnpluginBuilderVariant)\n );\n}\n\n/**\n * Check if a plugin should be deduplicated.\n *\n * @param plugin - The plugin to check\n * @param plugins - The list of plugins to check against\n * @returns True if the plugin should be deduplicated, false otherwise\n */\nexport function checkDedupe<\n TResolvedConfig extends ResolvedConfig = ResolvedConfig,\n TContext extends PluginContext<TResolvedConfig> =\n PluginContext<TResolvedConfig>\n>(plugin: Plugin<TContext>, plugins: Plugin<TContext>[]) {\n return (\n plugin.dedupe === false ||\n plugins.some(\n p =>\n p.dedupe !== false &&\n ((isFunction(p.dedupe) && p.dedupe(plugin)) || p.name === plugin.name)\n )\n );\n}\n\n/**\n * Add a plugin hook to the hooks list.\n *\n * @param context - The plugin context\n * @param plugin - The plugin to add the hook from\n * @param pluginHook - The plugin hook to add\n * @param hooksList - The list of hooks to add to\n */\nexport function addPluginHook<\n TContext extends PluginContext = PluginContext,\n TField extends PluginHookFields<TContext> = PluginHookFields<TContext>,\n TList extends HooksListItem<TContext, TField> = HooksListItem<\n TContext,\n TField\n >\n>(\n context: TContext,\n plugin: Plugin<TContext>,\n pluginHook: PluginHook<AnyFunction>,\n hooksList: TList[]\n) {\n if (\n !checkDedupe(plugin, hooksList.map(hook => hook.plugin).filter(Boolean))\n ) {\n const handler = ((...args: unknown[]) =>\n (\n getHookHandler<WithUnpluginBuildContext<TContext>, TField>(\n pluginHook\n ) as unknown as (...args: unknown[]) => unknown\n ).apply(context, args)) as GetHookHandlerReturnType<TContext, TField>;\n if (!handler) {\n return;\n }\n\n hooksList.push({\n plugin,\n handler\n } as any);\n }\n}\n\n/**\n * Check the provided {@link PluginConfig}, and return a stringified version of the invalid configuration. If an array is provided, check each item in the array.\n *\n * @param config - The plugin configuration to check\n * @returns Null if the configuration is valid, otherwise an array of stringified invalid configurations\n */\nexport function findInvalidPluginConfig<\n TContext extends PluginContext = PluginContext<ResolvedConfig>\n>(config: PluginConfig<TContext>): string[] | null {\n if (isPluginConfig<TContext>(config)) {\n return null;\n }\n\n if (Array.isArray(config as PluginConfig<TContext>[])) {\n const invalidItems: string[] = [];\n (config as PluginConfig<TContext>[]).forEach(item => {\n const invalid = findInvalidPluginConfig<TContext>(item);\n if (invalid) {\n invalidItems.push(...invalid.map(i => JSON.stringify(i, null, 2)));\n }\n });\n\n return invalidItems.length > 0 ? invalidItems : null;\n }\n\n return [JSON.stringify(config, null, 2)];\n}\n"],"mappings":";;;;;;;;;;;;;AAsDA,SAAgB,SAEd,OAA2C;AAC3C,QACE,YAAY,MAAM,IAClB,UAAU,SACV,YAAY,MAAM,KAAK,KACtB,YAAa,MAA2B,IAAI,IAC1C,SAAS,SAAS,YAAY,MAAM,IAAI,MAC1C,YAAa,MAA2B,mBAAmB,IACzD,wBAAwB,SACvB,WAAW,MAAM,mBAAmB,MACvC,YAAa,MAA2B,OAAO,IAC7C,YAAY,SAAS,WAAW,MAAM,OAAO,KAChD,oBAAoB,OAClB,SACE,YAAa,MAA2B,MAAM,IAC7C,QAAQ,UACN,qBAAsB,MAA2B,MAAM,IACrD,SAAS,YACR,YAAa,MAA2B,MAAM,EACvD;;;;;;;;AAUL,SAAgB,qBAEd,OAAuD;AACvD,QACE,YAAY,MAAM,IAClB,YAAY,WACT,YAAY,MAAM,OAAO,IAAI,WAAW,MAAM,OAAO,KACtD,aAAa,SACb,YAAY,MAAM,QAAQ,IAC1B,SAAS,MAAM,OAAO;;;;;;;;AAU5B,SAAgB,oBAEd,OAAsD;AACtD,QACE,MAAM,QAAQ,MAAM,KACnB,MAAM,WAAW,KAAK,MAAM,WAAW,QACrC,YAAY,MAAM,GAAG,IAAI,WAAW,MAAM,GAAG,KAC9C,MAAM,SAAS,KACf,YAAY,MA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IAAI,EAAE,OAAO,OAAO,IAAK,EAAE,SAAS,OAAO,MACpE;;;;;;;;;;AAYL,SAAgB,cAQd,SACA,QACA,YACA,WACA;AACA,KACE,CAAC,YAAY,QAAQ,UAAU,KAAI,SAAQ,KAAK,OAAO,CAAC,OAAO,QAAQ,CAAC,EACxE;EACA,MAAM,YAAY,GAAG,SAEjB,eACE,WACD,CACD,MAAM,SAAS,KAAK;AACxB,MAAI,CAAC,QACH;AAGF,YAAU,KAAK;GACb;GACA;GACD,CAAQ;;;;;;;;;AAUb,SAAgB,wBAEd,QAAiD;AACjD,KAAI,eAAyB,OAAO,CAClC,QAAO;AAGT,KAAI,MAAM,QAAQ,OAAmC,EAAE;EACrD,MAAM,eAAyB,EAAE;AACjC,EAAC,OAAoC,SAAQ,SAAQ;GACnD,MAAM,UAAU,wBAAkC,KAAK;AACvD,OAAI,QACF,cAAa,KAAK,GAAG,QAAQ,KAAI,MAAK,KAAK,UAAU,GAAG,MAAM,EAAE,CAAC,CAAC;IAEpE;AAEF,SAAO,aAAa,SAAS,IAAI,eAAe;;AAGlD,QAAO,CAAC,KAAK,UAAU,QAAQ,MAAM,EAAE,CAAC"}
|
|
1
|
+
{"version":3,"file":"helpers.mjs","names":[],"sources":["../../src/plugin-utils/helpers.ts"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Powerlines\n\n This code was released as part of the Powerlines project. Powerlines\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/powerlines.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/powerlines\n Documentation: https://docs.stormsoftware.com/projects/powerlines\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport { kebabCase } from \"@stryke/string-format/kebab-case\";\nimport { isFunction } from \"@stryke/type-checks/is-function\";\nimport { isSetObject } from \"@stryke/type-checks/is-set-object\";\nimport { isSetString } from \"@stryke/type-checks/is-set-string\";\nimport { isUndefined } from \"@stryke/type-checks/is-undefined\";\nimport { AnyFunction } from \"@stryke/types/base\";\nimport {\n PLUGIN_HOOKS_FIELDS,\n PLUGIN_NON_HOOK_FIELDS,\n UNPLUGIN_BUILDER_VARIANTS\n} from \"../constants/plugin\";\nimport type {\n PluginConfig,\n PluginConfigObject,\n PluginConfigTuple,\n ResolvedConfig\n} from \"../types/config\";\nimport type { PluginContext, WithUnpluginBuildContext } from \"../types/context\";\nimport type { HooksListItem } from \"../types/hooks\";\nimport type {\n Plugin,\n PluginHook,\n PluginHookFields,\n PluginHookObject,\n PluginHooks\n} from \"../types/plugin\";\nimport type {\n UnpluginBuilderVariant,\n UnpluginOptions\n} from \"../types/unplugin\";\n\n/**\n * Type guard to check if an object is a {@link Plugin}\n *\n * @param value - The object to check\n * @returns True if the object is a {@link Plugin}, false otherwise\n */\nexport function isPlugin<\n TContext extends PluginContext = PluginContext<ResolvedConfig>\n>(value: unknown): value is Plugin<TContext> {\n return (\n isSetObject(value) &&\n \"name\" in value &&\n isSetString(value.name) &&\n (isUndefined((value as Plugin<TContext>).api) ||\n (\"api\" in value && isSetObject(value.api))) &&\n (isUndefined((value as Plugin<TContext>).applyToEnvironment) ||\n (\"applyToEnvironment\" in value &&\n isFunction(value.applyToEnvironment))) &&\n (isUndefined((value as Plugin<TContext>).dedupe) ||\n (\"dedupe\" in value && isFunction(value.dedupe))) &&\n PLUGIN_HOOKS_FIELDS.every(\n hook =>\n isUndefined((value as Plugin<TContext>)[hook]) ||\n (hook in value &&\n (isPluginHookFunction((value as Plugin<TContext>)[hook]) ||\n (hook === \"config\" &&\n isSetObject((value as Plugin<TContext>)[hook]))))\n )\n );\n}\n\n/**\n * Type guard to check if an object is a {@link PluginConfigObject}\n *\n * @param value - The object to check\n * @returns True if the object is a {@link PluginConfigObject}, false otherwise\n */\nexport function isPluginConfigObject<\n TContext extends PluginContext = PluginContext<ResolvedConfig>\n>(value: unknown): value is PluginConfigObject<TContext> {\n return (\n isSetObject(value) &&\n \"plugin\" in value &&\n (((isSetString(value.plugin) || isFunction(value.plugin)) &&\n \"options\" in value &&\n isSetObject(value.options)) ||\n isPlugin(value.plugin))\n );\n}\n\n/**\n * Type guard to check if an object is a {@link PluginConfigTuple}\n *\n * @param value - The object to check\n * @returns True if the object is a {@link PluginConfigTuple}, false otherwise\n */\nexport function isPluginConfigTuple<\n TContext extends PluginContext = PluginContext<ResolvedConfig>\n>(value: unknown): value is PluginConfigTuple<TContext> {\n return (\n Array.isArray(value) &&\n (value.length === 1 || value.length === 2) &&\n (((isSetString(value[0]) || isFunction(value[0])) &&\n value.length > 1 &&\n isSetObject(value[1])) ||\n isPlugin(value[0]))\n );\n}\n\n/**\n * Type guard to check if an object is a {@link PluginConfig}\n *\n * @param value - The object to check\n * @returns True if the object is a {@link PluginConfig}, false otherwise\n */\nexport function isPluginConfig<\n TContext extends PluginContext = PluginContext<ResolvedConfig>\n>(value: unknown): value is PluginConfig<TContext> {\n return (\n isSetString(value) ||\n isFunction(value) ||\n isPlugin<TContext>(value) ||\n isPluginConfigObject(value) ||\n isPluginConfigTuple(value) ||\n (Array.isArray(value) && value.every(item => isPluginConfig(item)))\n );\n}\n\n/**\n * Type guard to check if an value is a {@link PluginHook} function\n *\n * @param value - The value to check\n * @returns True if the value is a {@link PluginHook} function, false otherwise\n */\nexport function isPluginHookObject(\n value: unknown\n): value is PluginHookObject<AnyFunction> {\n return isSetObject(value) && \"handler\" in value && isFunction(value.handler);\n}\n\n/**\n * Type guard to check if an value is a {@link PluginHook} function\n *\n * @param value - The value to check\n * @returns True if the value is a {@link PluginHook} function, false otherwise\n */\nexport function isPluginHookFunction(value: unknown): value is AnyFunction {\n return isFunction(value) || isPluginHookObject(value);\n}\n\n/**\n * Type guard to check if an object is a {@link PluginHook}\n *\n * @param value - The object to check\n * @returns True if the object is a {@link PluginHook}, false otherwise\n */\nexport function isPluginHook(value: unknown): value is PluginHook<AnyFunction> {\n return isPluginHookFunction(value) || isPluginHookObject(value);\n}\n\nexport type GetHookHandlerReturnType<\n TContext extends PluginContext = PluginContext,\n TField extends string = string\n> = HooksListItem<TContext, TField>[\"handler\"];\n\n/**\n * Extract the hook handler function from a plugin hook\n *\n * @param pluginHook - The plugin hook to extract the handler function from\n * @returns The hook handler function\n */\nexport function getHookHandler<\n TContext extends PluginContext = PluginContext,\n TKey extends string = string\n>(\n pluginHook: PluginHook<AnyFunction>\n): GetHookHandlerReturnType<TContext, TKey> {\n return (\n isFunction(pluginHook) ? pluginHook : pluginHook.handler\n ) as GetHookHandlerReturnType<TContext, TKey>;\n}\n\n/**\n * Extract a plugin hook from a plugin\n *\n * @param context - The build context\n * @param plugin - The plugin to extract the hook from\n * @param hook - The name of the hook to extract\n * @returns The extracted hook, or undefined if the hook does not exist\n */\nexport function extractPluginHook<\n TContext extends PluginContext = PluginContext,\n TPlugin extends Plugin<TContext> = Plugin<TContext>\n>(context: TContext, plugin: TPlugin, hook: keyof PluginHooks<TContext>) {\n const pluginHook = plugin[hook];\n if (!isPluginHook(pluginHook)) {\n return undefined;\n }\n\n return isFunction(pluginHook)\n ? {\n normal: pluginHook.bind(context)\n }\n : {\n [pluginHook.order ? pluginHook.order : \"normal\"]:\n pluginHook.handler.bind(context)\n };\n}\n\n/**\n * Check if a hook is external.\n *\n * @param keys - The name of the hook to check.\n * @returns True if the hook is external, false otherwise.\n */\nexport function isUnpluginHookKey<\n TUnpluginBuilderVariant extends UnpluginBuilderVariant =\n UnpluginBuilderVariant\n>(\n keys: string\n): keys is `${TUnpluginBuilderVariant}:${keyof UnpluginOptions[TUnpluginBuilderVariant] & string}` {\n return UNPLUGIN_BUILDER_VARIANTS.some(variant =>\n keys.startsWith(`${variant}:`)\n );\n}\n\n/**\n * Check if a hook is internal.\n *\n * @param keys - The name of the hook to check.\n * @returns True if the hook is external, false otherwise.\n */\nexport function isPluginHookField<TContext extends PluginContext>(\n keys: string\n) {\n return !PLUGIN_NON_HOOK_FIELDS.includes(keys as PluginHookFields<TContext>);\n}\n\n/**\n * Check if a hook is external.\n *\n * @param field - The name of the hook to check.\n * @returns True if the hook is external, false otherwise.\n */\nexport function isUnpluginHookField<\n TUnpluginBuilderVariant extends UnpluginBuilderVariant =\n UnpluginBuilderVariant\n>(field: string): field is TUnpluginBuilderVariant {\n return (\n !isPluginHookField(field) &&\n UNPLUGIN_BUILDER_VARIANTS.includes(field as UnpluginBuilderVariant)\n );\n}\n\n/**\n * Check if a plugin should be deduplicated.\n *\n * @param plugin - The plugin to check\n * @param plugins - The list of plugins to check against\n * @returns True if the plugin should be deduplicated, false otherwise\n */\nexport function isDuplicate<\n TResolvedConfig extends ResolvedConfig = ResolvedConfig,\n TContext extends PluginContext<TResolvedConfig> =\n PluginContext<TResolvedConfig>\n>(plugin: Plugin<TContext>, plugins: Plugin<TContext>[]) {\n return (\n plugin.dedupe !== false &&\n plugins.some(\n p =>\n p.dedupe !== false &&\n ((isFunction(p.dedupe) && p.dedupe(plugin)) ||\n kebabCase(p.name) === kebabCase(plugin.name))\n )\n );\n}\n\n/**\n * Remove duplicate hooks from a list of hooks, keeping the first occurrence of each plugin.\n *\n * @param hooksList - The list of hooks to deduplicate.\n * @returns A new list of hooks with duplicates removed.\n */\nexport function dedupeHooklist<\n TContext extends PluginContext = PluginContext,\n TField extends PluginHookFields<TContext> = PluginHookFields<TContext>,\n TList extends HooksListItem<TContext, TField> = HooksListItem<\n TContext,\n TField\n >\n>(hooksList: TList[]): TList[] {\n return hooksList.reduce((ret, hook) => {\n if (\n !isDuplicate(\n hook.plugin,\n ret.map(h => h.plugin)\n )\n ) {\n ret.push(hook);\n }\n return ret;\n }, [] as TList[]);\n}\n\n/**\n * Add a plugin hook to the hooks list.\n *\n * @param context - The plugin context\n * @param plugin - The plugin to add the hook from\n * @param pluginHook - The plugin hook to add\n * @param hooksList - The list of hooks to add to\n */\nexport function addPluginHook<\n TContext extends PluginContext = PluginContext,\n TField extends PluginHookFields<TContext> = PluginHookFields<TContext>,\n TList extends HooksListItem<TContext, TField> = HooksListItem<\n TContext,\n TField\n >\n>(\n context: TContext,\n plugin: Plugin<TContext>,\n pluginHook: PluginHook<AnyFunction>,\n hooksList: TList[]\n): TList[] {\n if (\n !isDuplicate(plugin, hooksList.map(hook => hook.plugin).filter(Boolean))\n ) {\n const handler = ((...args: unknown[]) =>\n (\n getHookHandler<WithUnpluginBuildContext<TContext>, TField>(\n pluginHook\n ) as unknown as (...args: unknown[]) => unknown\n ).apply(context, args)) as GetHookHandlerReturnType<TContext, TField>;\n if (!handler) {\n return hooksList;\n }\n\n hooksList.push({\n plugin,\n handler\n } as any);\n }\n\n return hooksList;\n}\n\n/**\n * Check the provided {@link PluginConfig}, and return a stringified version of the invalid configuration. If an array is provided, check each item in the array.\n *\n * @param config - The plugin configuration to check\n * @returns Null if the configuration is valid, otherwise an array of stringified invalid configurations\n */\nexport function findInvalidPluginConfig<\n TContext extends PluginContext = PluginContext<ResolvedConfig>\n>(config: PluginConfig<TContext>): string[] | null {\n if (isPluginConfig<TContext>(config)) {\n return null;\n }\n\n if (Array.isArray(config as PluginConfig<TContext>[])) {\n const invalidItems: string[] = [];\n (config as PluginConfig<TContext>[]).forEach(item => {\n const invalid = findInvalidPluginConfig<TContext>(item);\n if (invalid) {\n invalidItems.push(...invalid.map(i => JSON.stringify(i, null, 2)));\n }\n });\n\n return invalidItems.length > 0 ? invalidItems : null;\n }\n\n return [JSON.stringify(config, null, 2)];\n}\n"],"mappings":";;;;;;;;;;;;;;AAuDA,SAAgB,SAEd,OAA2C;AAC3C,QACE,YAAY,MAAM,IAClB,UAAU,SACV,YAAY,MAAM,KAAK,KACtB,YAAa,MAA2B,IAAI,IAC1C,SAAS,SAAS,YAAY,MAAM,IAAI,MAC1C,YAAa,MAA2B,mBAAmB,IACzD,wBAAwB,SACvB,WAAW,MAAM,mBAAmB,MACvC,YAAa,MAA2B,OAAO,IAC7C,YAAY,SAAS,WAAW,MAAM,OAAO,KAChD,oBAAoB,OAClB,SAC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vD,OAAI,QACF,cAAa,KAAK,GAAG,QAAQ,KAAI,MAAK,KAAK,UAAU,GAAG,MAAM,EAAE,CAAC,CAAC;IAEpE;AAEF,SAAO,aAAa,SAAS,IAAI,eAAe;;AAGlD,QAAO,CAAC,KAAK,UAAU,QAAQ,MAAM,EAAE,CAAC"}
|
|
@@ -11,9 +11,9 @@ const require_plugin_utils_get_config_path = require('./get-config-path.cjs');
|
|
|
11
11
|
const require_plugin_utils_modules = require('./modules.cjs');
|
|
12
12
|
|
|
13
13
|
exports.addPluginHook = require_plugin_utils_helpers.addPluginHook;
|
|
14
|
-
exports.checkDedupe = require_plugin_utils_helpers.checkDedupe;
|
|
15
14
|
exports.combinePluginOptions = require_plugin_utils_combine_plugins.combinePluginOptions;
|
|
16
15
|
exports.combinePlugins = require_plugin_utils_combine_plugins.combinePlugins;
|
|
16
|
+
exports.dedupeHooklist = require_plugin_utils_helpers.dedupeHooklist;
|
|
17
17
|
exports.extend = require_plugin_utils_extend.extend;
|
|
18
18
|
exports.extractPluginHook = require_plugin_utils_helpers.extractPluginHook;
|
|
19
19
|
exports.findInvalidPluginConfig = require_plugin_utils_helpers.findInvalidPluginConfig;
|
|
@@ -24,6 +24,7 @@ exports.getHookHandler = require_plugin_utils_helpers.getHookHandler;
|
|
|
24
24
|
exports.getOrganizationName = require_plugin_utils_context_helpers.getOrganizationName;
|
|
25
25
|
exports.getWorkspaceName = require_plugin_utils_context_helpers.getWorkspaceName;
|
|
26
26
|
exports.isBuiltinModule = require_plugin_utils_modules.isBuiltinModule;
|
|
27
|
+
exports.isDuplicate = require_plugin_utils_helpers.isDuplicate;
|
|
27
28
|
exports.isPlugin = require_plugin_utils_helpers.isPlugin;
|
|
28
29
|
exports.isPluginConfig = require_plugin_utils_helpers.isPluginConfig;
|
|
29
30
|
exports.isPluginConfigObject = require_plugin_utils_helpers.isPluginConfigObject;
|
|
@@ -4,8 +4,8 @@ import { getOrganizationName, getWorkspaceName } from "./context-helpers.cjs";
|
|
|
4
4
|
import { extend } from "./extend.cjs";
|
|
5
5
|
import { formatPackageJson } from "./format-package-json.cjs";
|
|
6
6
|
import { getConfigPath } from "./get-config-path.cjs";
|
|
7
|
-
import { GetHookHandlerReturnType, __ΩGetHookHandlerReturnType, addPluginHook,
|
|
7
|
+
import { GetHookHandlerReturnType, __ΩGetHookHandlerReturnType, addPluginHook, dedupeHooklist, extractPluginHook, findInvalidPluginConfig, getHookHandler, isDuplicate, isPlugin, isPluginConfig, isPluginConfigObject, isPluginConfigTuple, isPluginHook, isPluginHookField, isPluginHookFunction, isPluginHookObject, isUnpluginHookField, isUnpluginHookKey } from "./helpers.cjs";
|
|
8
8
|
import { MergeResult, __ΩMergeResult, merge, mergeConfig } from "./merge.cjs";
|
|
9
9
|
import { isBuiltinModule } from "./modules.cjs";
|
|
10
10
|
import { replacePathTokens } from "./paths.cjs";
|
|
11
|
-
export { CombinePluginsOptions, GetDependencyConfigResult, GetHookHandlerReturnType, MergeResult, __ΩCombinePluginsOptions, __ΩGetDependencyConfigResult, __ΩGetHookHandlerReturnType, __ΩMergeResult, addPluginHook,
|
|
11
|
+
export { CombinePluginsOptions, GetDependencyConfigResult, GetHookHandlerReturnType, MergeResult, __ΩCombinePluginsOptions, __ΩGetDependencyConfigResult, __ΩGetHookHandlerReturnType, __ΩMergeResult, addPluginHook, combinePluginOptions, combinePlugins, dedupeHooklist, extend, extractPluginHook, findInvalidPluginConfig, formatPackageJson, getConfigPath, getDependencyConfig, getHookHandler, getOrganizationName, getWorkspaceName, isBuiltinModule, isDuplicate, isPlugin, isPluginConfig, isPluginConfigObject, isPluginConfigTuple, isPluginHook, isPluginHookField, isPluginHookFunction, isPluginHookObject, isUnpluginHookField, isUnpluginHookKey, merge, mergeConfig, replacePathTokens };
|
|
@@ -4,8 +4,8 @@ import { getOrganizationName, getWorkspaceName } from "./context-helpers.mjs";
|
|
|
4
4
|
import { extend } from "./extend.mjs";
|
|
5
5
|
import { formatPackageJson } from "./format-package-json.mjs";
|
|
6
6
|
import { getConfigPath } from "./get-config-path.mjs";
|
|
7
|
-
import { GetHookHandlerReturnType, __ΩGetHookHandlerReturnType, addPluginHook,
|
|
7
|
+
import { GetHookHandlerReturnType, __ΩGetHookHandlerReturnType, addPluginHook, dedupeHooklist, extractPluginHook, findInvalidPluginConfig, getHookHandler, isDuplicate, isPlugin, isPluginConfig, isPluginConfigObject, isPluginConfigTuple, isPluginHook, isPluginHookField, isPluginHookFunction, isPluginHookObject, isUnpluginHookField, isUnpluginHookKey } from "./helpers.mjs";
|
|
8
8
|
import { MergeResult, __ΩMergeResult, merge, mergeConfig } from "./merge.mjs";
|
|
9
9
|
import { isBuiltinModule } from "./modules.mjs";
|
|
10
10
|
import { replacePathTokens } from "./paths.mjs";
|
|
11
|
-
export { CombinePluginsOptions, GetDependencyConfigResult, GetHookHandlerReturnType, MergeResult, __ΩCombinePluginsOptions, __ΩGetDependencyConfigResult, __ΩGetHookHandlerReturnType, __ΩMergeResult, addPluginHook,
|
|
11
|
+
export { CombinePluginsOptions, GetDependencyConfigResult, GetHookHandlerReturnType, MergeResult, __ΩCombinePluginsOptions, __ΩGetDependencyConfigResult, __ΩGetHookHandlerReturnType, __ΩMergeResult, addPluginHook, combinePluginOptions, combinePlugins, dedupeHooklist, extend, extractPluginHook, findInvalidPluginConfig, formatPackageJson, getConfigPath, getDependencyConfig, getHookHandler, getOrganizationName, getWorkspaceName, isBuiltinModule, isDuplicate, isPlugin, isPluginConfig, isPluginConfigObject, isPluginConfigTuple, isPluginHook, isPluginHookField, isPluginHookFunction, isPluginHookObject, isUnpluginHookField, isUnpluginHookKey, merge, mergeConfig, replacePathTokens };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { replacePathTokens } from "./paths.mjs";
|
|
2
2
|
import { formatPackageJson } from "./format-package-json.mjs";
|
|
3
3
|
import { getDependencyConfig } from "./build-helpers.mjs";
|
|
4
|
-
import { addPluginHook,
|
|
4
|
+
import { addPluginHook, dedupeHooklist, extractPluginHook, findInvalidPluginConfig, getHookHandler, isDuplicate, isPlugin, isPluginConfig, isPluginConfigObject, isPluginConfigTuple, isPluginHook, isPluginHookField, isPluginHookFunction, isPluginHookObject, isUnpluginHookField, isUnpluginHookKey } from "./helpers.mjs";
|
|
5
5
|
import { merge, mergeConfig } from "./merge.mjs";
|
|
6
6
|
import { combinePluginOptions, combinePlugins } from "./combine-plugins.mjs";
|
|
7
7
|
import { getOrganizationName, getWorkspaceName } from "./context-helpers.mjs";
|
|
@@ -9,4 +9,4 @@ import { extend } from "./extend.mjs";
|
|
|
9
9
|
import { getConfigPath } from "./get-config-path.mjs";
|
|
10
10
|
import { isBuiltinModule } from "./modules.mjs";
|
|
11
11
|
|
|
12
|
-
export { addPluginHook,
|
|
12
|
+
export { addPluginHook, combinePluginOptions, combinePlugins, dedupeHooklist, extend, extractPluginHook, findInvalidPluginConfig, formatPackageJson, getConfigPath, getDependencyConfig, getHookHandler, getOrganizationName, getWorkspaceName, isBuiltinModule, isDuplicate, isPlugin, isPluginConfig, isPluginConfigObject, isPluginConfigTuple, isPluginHook, isPluginHookField, isPluginHookFunction, isPluginHookObject, isUnpluginHookField, isUnpluginHookKey, merge, mergeConfig, replacePathTokens };
|
package/dist/types/config.d.cts
CHANGED
|
@@ -15,6 +15,7 @@ import { PreviewOptions, ResolvedConfig as ResolvedConfig$1, ResolvedPreviewOpti
|
|
|
15
15
|
//#region src/types/config.d.ts
|
|
16
16
|
type LogLevel = "error" | "warn" | "info" | "debug" | "trace";
|
|
17
17
|
type LogFn = (type: LogLevelLabel, ...args: string[]) => void;
|
|
18
|
+
type LogLevelConfig = Record<LogLevel, boolean>;
|
|
18
19
|
interface Logger {
|
|
19
20
|
log: LogFn;
|
|
20
21
|
level: LogLevelLabel;
|
|
@@ -629,6 +630,7 @@ type ResolvedConfig$2<TUserConfig extends UserConfig = UserConfig> = Omit<TUserC
|
|
|
629
630
|
};
|
|
630
631
|
declare type __ΩLogLevel = any[];
|
|
631
632
|
declare type __ΩLogFn = any[];
|
|
633
|
+
declare type __ΩLogLevelConfig = any[];
|
|
632
634
|
declare type __ΩLogger = any[];
|
|
633
635
|
declare type __ΩWorkspaceConfig = any[];
|
|
634
636
|
declare type __ΩPluginFactory = any[];
|
|
@@ -668,5 +670,5 @@ declare type __ΩCopyResolvedConfig = any[];
|
|
|
668
670
|
declare type __ΩOutputResolvedConfig = any[];
|
|
669
671
|
declare type __ΩResolvedConfig = any[];
|
|
670
672
|
//#endregion
|
|
671
|
-
export { AnyOutputUserConfig, AnyUserConfig, BuildInlineConfig, CleanInlineConfig, Config, ConfigEnv, CopyConfig, CopyResolvedConfig, DeployInlineConfig, DocsInlineConfig, EnvironmentConfig, EnvironmentResolvedConfig, InitialUserConfig, InlineConfig, LintInlineConfig, LogFn, LogLevel, Logger, NewInlineConfig, OutputConfig, OutputResolvedConfig, ParsedUserConfig, PartialPlugin, PartialPluginFactory, PluginConfig, PluginConfigObject, PluginConfigTuple, PluginFactory, PowerlinesCommand, PrepareInlineConfig, ProjectType, ResolveConfig, ResolveResolvedConfig, ResolvedAssetGlob, ResolvedConfig$2 as ResolvedConfig, ResolvedEntryTypeDefinition, TypesInlineConfig, UserConfig, UserConfigFn, WorkspaceConfig, __ΩAnyOutputUserConfig, __ΩAnyUserConfig, __ΩBuildInlineConfig, __ΩCleanInlineConfig, __ΩConfig, __ΩConfigEnv, __ΩCopyConfig, __ΩCopyResolvedConfig, __ΩDeployInlineConfig, __ΩDocsInlineConfig, __ΩEnvironmentConfig, __ΩEnvironmentResolvedConfig, __ΩInitialUserConfig, __ΩInlineConfig, __ΩLintInlineConfig, __ΩLogFn, __ΩLogLevel, __ΩLogger, __ΩNewInlineConfig, __ΩOutputConfig, __ΩOutputResolvedConfig, __ΩParsedUserConfig, __ΩPartialPlugin, __ΩPartialPluginFactory, __ΩPluginConfig, __ΩPluginConfigObject, __ΩPluginConfigTuple, __ΩPluginFactory, __ΩPowerlinesCommand, __ΩPrepareInlineConfig, __ΩProjectType, __ΩResolveConfig, __ΩResolveResolvedConfig, __ΩResolvedAssetGlob, __ΩResolvedConfig, __ΩResolvedEntryTypeDefinition, __ΩTypesInlineConfig, __ΩUserConfig, __ΩUserConfigFn, __ΩWorkspaceConfig };
|
|
673
|
+
export { AnyOutputUserConfig, AnyUserConfig, BuildInlineConfig, CleanInlineConfig, Config, ConfigEnv, CopyConfig, CopyResolvedConfig, DeployInlineConfig, DocsInlineConfig, EnvironmentConfig, EnvironmentResolvedConfig, InitialUserConfig, InlineConfig, LintInlineConfig, LogFn, LogLevel, LogLevelConfig, Logger, NewInlineConfig, OutputConfig, OutputResolvedConfig, ParsedUserConfig, PartialPlugin, PartialPluginFactory, PluginConfig, PluginConfigObject, PluginConfigTuple, PluginFactory, PowerlinesCommand, PrepareInlineConfig, ProjectType, ResolveConfig, ResolveResolvedConfig, ResolvedAssetGlob, ResolvedConfig$2 as ResolvedConfig, ResolvedEntryTypeDefinition, TypesInlineConfig, UserConfig, UserConfigFn, WorkspaceConfig, __ΩAnyOutputUserConfig, __ΩAnyUserConfig, __ΩBuildInlineConfig, __ΩCleanInlineConfig, __ΩConfig, __ΩConfigEnv, __ΩCopyConfig, __ΩCopyResolvedConfig, __ΩDeployInlineConfig, __ΩDocsInlineConfig, __ΩEnvironmentConfig, __ΩEnvironmentResolvedConfig, __ΩInitialUserConfig, __ΩInlineConfig, __ΩLintInlineConfig, __ΩLogFn, __ΩLogLevel, __ΩLogLevelConfig, __ΩLogger, __ΩNewInlineConfig, __ΩOutputConfig, __ΩOutputResolvedConfig, __ΩParsedUserConfig, __ΩPartialPlugin, __ΩPartialPluginFactory, __ΩPluginConfig, __ΩPluginConfigObject, __ΩPluginConfigTuple, __ΩPluginFactory, __ΩPowerlinesCommand, __ΩPrepareInlineConfig, __ΩProjectType, __ΩResolveConfig, __ΩResolveResolvedConfig, __ΩResolvedAssetGlob, __ΩResolvedConfig, __ΩResolvedEntryTypeDefinition, __ΩTypesInlineConfig, __ΩUserConfig, __ΩUserConfigFn, __ΩWorkspaceConfig };
|
|
672
674
|
//# sourceMappingURL=config.d.cts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.d.cts","names":[],"sources":["../../src/types/config.ts"],"mappings":";;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"config.d.cts","names":[],"sources":["../../src/types/config.ts"],"mappings":";;;;;;;;;;;;;;;KA2CY,QAAA;AAAA,KAEA,KAAA,IAAS,IAAA,EAAM,aAAA,KAAkB,IAAA;AAAA,KAEjC,cAAA,GAAiB,MAAA,CAAO,QAAA;AAAA,UAEnB,MAAA;EACf,GAAA,EAAK,KAAA;EACL,KAAA,EAAO,aAAA;AAAA;AANT;;;AAAA,KAYY,eAAA,GAAkB,OAAA,CAAQ,oBAAA,IACpC,QAAA,CAAS,IAAA,CAAK,oBAAA;AAAA,KAEJ,aAAA,yBACc,aAAA,GAAgB,aAAA,qBAErC,OAAA,EAAS,QAAA,KAAa,YAAA,CAAa,MAAA,CAAO,QAAA,IAAY,MAAA,CAAO,QAAA;;;;KAKtD,iBAAA,kBACO,aAAA,GAAgB,aAAA,8BAErB,aAAA,CAAc,QAAA,EAAU,QAAA,GAAW,QAAA,KAAa,MAAA,CAAO,QAAA;AAxBrE;;;AAAA,KA6BY,kBAAA,kBACO,aAAA,GAAgB,aAAA;EAI7B,MAAA,WAAiB,aAAA,CAAc,QAAA,EAAU,QAAA;EACzC,OAAA,EAAS,QAAA;AAAA;EAGT,MAAA,EAAQ,MAAA,CAAO,QAAA;EACf,OAAA;AAAA;;;;KAMM,YAAA,kBAA8B,aAAA,GAAgB,aAAA,aAEtD,aAAA,CAAc,QAAA,UACd,MAAA,CAAO,QAAA,IACP,iBAAA,CAAkB,QAAA,IAClB,kBAAA,CAAmB,QAAA,IACnB,OAAA,CAAQ,YAAA,CAAa,QAAA,KACrB,YAAA,CAAa,QAAA;AAAA,KAEL,aAAA,kBAA+B,aAAA,GAAgB,aAAA,IACzD,WAAA,CAAY,MAAA,CAAO,QAAA;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A,EAAU,QAAA;AAAA;AAAA"}
|
package/dist/types/config.d.mts
CHANGED
|
@@ -15,6 +15,7 @@ import { PreviewOptions, ResolvedConfig as ResolvedConfig$1, ResolvedPreviewOpti
|
|
|
15
15
|
//#region src/types/config.d.ts
|
|
16
16
|
type LogLevel = "error" | "warn" | "info" | "debug" | "trace";
|
|
17
17
|
type LogFn = (type: LogLevelLabel, ...args: string[]) => void;
|
|
18
|
+
type LogLevelConfig = Record<LogLevel, boolean>;
|
|
18
19
|
interface Logger {
|
|
19
20
|
log: LogFn;
|
|
20
21
|
level: LogLevelLabel;
|
|
@@ -629,6 +630,7 @@ type ResolvedConfig$2<TUserConfig extends UserConfig = UserConfig> = Omit<TUserC
|
|
|
629
630
|
};
|
|
630
631
|
declare type __ΩLogLevel = any[];
|
|
631
632
|
declare type __ΩLogFn = any[];
|
|
633
|
+
declare type __ΩLogLevelConfig = any[];
|
|
632
634
|
declare type __ΩLogger = any[];
|
|
633
635
|
declare type __ΩWorkspaceConfig = any[];
|
|
634
636
|
declare type __ΩPluginFactory = any[];
|
|
@@ -668,5 +670,5 @@ declare type __ΩCopyResolvedConfig = any[];
|
|
|
668
670
|
declare type __ΩOutputResolvedConfig = any[];
|
|
669
671
|
declare type __ΩResolvedConfig = any[];
|
|
670
672
|
//#endregion
|
|
671
|
-
export { AnyOutputUserConfig, AnyUserConfig, BuildInlineConfig, CleanInlineConfig, Config, ConfigEnv, CopyConfig, CopyResolvedConfig, DeployInlineConfig, DocsInlineConfig, EnvironmentConfig, EnvironmentResolvedConfig, InitialUserConfig, InlineConfig, LintInlineConfig, LogFn, LogLevel, Logger, NewInlineConfig, OutputConfig, OutputResolvedConfig, ParsedUserConfig, PartialPlugin, PartialPluginFactory, PluginConfig, PluginConfigObject, PluginConfigTuple, PluginFactory, PowerlinesCommand, PrepareInlineConfig, ProjectType, ResolveConfig, ResolveResolvedConfig, ResolvedAssetGlob, ResolvedConfig$2 as ResolvedConfig, ResolvedEntryTypeDefinition, TypesInlineConfig, UserConfig, UserConfigFn, WorkspaceConfig, __ΩAnyOutputUserConfig, __ΩAnyUserConfig, __ΩBuildInlineConfig, __ΩCleanInlineConfig, __ΩConfig, __ΩConfigEnv, __ΩCopyConfig, __ΩCopyResolvedConfig, __ΩDeployInlineConfig, __ΩDocsInlineConfig, __ΩEnvironmentConfig, __ΩEnvironmentResolvedConfig, __ΩInitialUserConfig, __ΩInlineConfig, __ΩLintInlineConfig, __ΩLogFn, __ΩLogLevel, __ΩLogger, __ΩNewInlineConfig, __ΩOutputConfig, __ΩOutputResolvedConfig, __ΩParsedUserConfig, __ΩPartialPlugin, __ΩPartialPluginFactory, __ΩPluginConfig, __ΩPluginConfigObject, __ΩPluginConfigTuple, __ΩPluginFactory, __ΩPowerlinesCommand, __ΩPrepareInlineConfig, __ΩProjectType, __ΩResolveConfig, __ΩResolveResolvedConfig, __ΩResolvedAssetGlob, __ΩResolvedConfig, __ΩResolvedEntryTypeDefinition, __ΩTypesInlineConfig, __ΩUserConfig, __ΩUserConfigFn, __ΩWorkspaceConfig };
|
|
673
|
+
export { AnyOutputUserConfig, AnyUserConfig, BuildInlineConfig, CleanInlineConfig, Config, ConfigEnv, CopyConfig, CopyResolvedConfig, DeployInlineConfig, DocsInlineConfig, EnvironmentConfig, EnvironmentResolvedConfig, InitialUserConfig, InlineConfig, LintInlineConfig, LogFn, LogLevel, LogLevelConfig, Logger, NewInlineConfig, OutputConfig, OutputResolvedConfig, ParsedUserConfig, PartialPlugin, PartialPluginFactory, PluginConfig, PluginConfigObject, PluginConfigTuple, PluginFactory, PowerlinesCommand, PrepareInlineConfig, ProjectType, ResolveConfig, ResolveResolvedConfig, ResolvedAssetGlob, ResolvedConfig$2 as ResolvedConfig, ResolvedEntryTypeDefinition, TypesInlineConfig, UserConfig, UserConfigFn, WorkspaceConfig, __ΩAnyOutputUserConfig, __ΩAnyUserConfig, __ΩBuildInlineConfig, __ΩCleanInlineConfig, __ΩConfig, __ΩConfigEnv, __ΩCopyConfig, __ΩCopyResolvedConfig, __ΩDeployInlineConfig, __ΩDocsInlineConfig, __ΩEnvironmentConfig, __ΩEnvironmentResolvedConfig, __ΩInitialUserConfig, __ΩInlineConfig, __ΩLintInlineConfig, __ΩLogFn, __ΩLogLevel, __ΩLogLevelConfig, __ΩLogger, __ΩNewInlineConfig, __ΩOutputConfig, __ΩOutputResolvedConfig, __ΩParsedUserConfig, __ΩPartialPlugin, __ΩPartialPluginFactory, __ΩPluginConfig, __ΩPluginConfigObject, __ΩPluginConfigTuple, __ΩPluginFactory, __ΩPowerlinesCommand, __ΩPrepareInlineConfig, __ΩProjectType, __ΩResolveConfig, __ΩResolveResolvedConfig, __ΩResolvedAssetGlob, __ΩResolvedConfig, __ΩResolvedEntryTypeDefinition, __ΩTypesInlineConfig, __ΩUserConfig, __ΩUserConfigFn, __ΩWorkspaceConfig };
|
|
672
674
|
//# sourceMappingURL=config.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.d.mts","names":[],"sources":["../../src/types/config.ts"],"mappings":";;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"config.d.mts","names":[],"sources":["../../src/types/config.ts"],"mappings":";;;;;;;;;;;;;;;KA2CY,QAAA;AAAA,KAEA,KAAA,IAAS,IAAA,EAAM,aAAA,KAAkB,IAAA;AAAA,KAEjC,cAAA,GAAiB,MAAA,CAAO,QAAA;AAAA,UAEnB,MAAA;EACf,GAAA,EAAK,KAAA;EACL,KAAA,EAAO,aAAA;AAAA;AANT;;;AAAA,KAYY,eAAA,GAAkB,OAAA,CAAQ,oBAAA,IACpC,QAAA,CAAS,IAAA,CAAK,oBAAA;AAAA,KAEJ,aAAA,yBACc,aAAA,GAAgB,aAAA,qBAErC,OAAA,EAAS,QAAA,KAAa,YAAA,CAAa,MAAA,CAAO,QAAA,IAAY,MAAA,CAAO,QAAA;;;;KAKtD,iBAAA,kBACO,aAAA,GAAgB,aAAA,8BAErB,aAAA,CAAc,QAAA,EAAU,QA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A,KAGE,oBAAA,GAAuB,QAAA,CACjC,IAAA,CAAK,YAAA,yBAEL,IAAA,CAAK,YAAA;EACH,IAAA,EAAM,kBAAA;AAAA;;AAnGV;;KAyGY,gBAAA,qBAAmC,UAAA,GAAa,UAAA,IAAc,IAAA,CACxE,WAAA,kNAkBA,QAAA,CACE,IAAA,CACE,WAAA;EA9HkB;;AAKxB;EA4II,MAAA,EAAQ,oBAAA;EA5IY;;;EAiJpB,OAAA,EAAS,qBAAA;EA1IQ;;;;;;;;;;EAsJjB,iBAAA,EAAmB,kBAAA;EAvJnB;;;EA4JA,YAAA,EAAc,YAAA,CAAa,WAAA;EA3JV;;;EAgKjB,UAAA,EAAY,WAAA;EA9Je;;;EAmK3B,OAAA,EAAS,YAAA,CAAa,YAAA,CAAa,WAAA;EAnKL;;;;;EA0K9B,QAAA,EAAU,QAAA;AAAA;AAAA"}
|
package/dist/types/context.d.cts
CHANGED
|
@@ -178,6 +178,20 @@ interface UnresolvedContext<TResolvedConfig extends ResolvedConfig = ResolvedCon
|
|
|
178
178
|
* A logging function for trace messages
|
|
179
179
|
*/
|
|
180
180
|
trace: (message: string | UnpluginMessage) => void;
|
|
181
|
+
/**
|
|
182
|
+
* A function to create a timer for measuring the duration of asynchronous operations
|
|
183
|
+
*
|
|
184
|
+
* @example
|
|
185
|
+
* ```ts
|
|
186
|
+
* const stopTimer = context.timer("Your Async Operation");
|
|
187
|
+
* await performAsyncOperation();
|
|
188
|
+
* stopTimer(); // "Your Async Operation completed in 123.45 milliseconds"
|
|
189
|
+
* ```
|
|
190
|
+
*
|
|
191
|
+
* @param name - The name of the timer.
|
|
192
|
+
* @returns A function that, when called, stops the timer and logs the duration.
|
|
193
|
+
*/
|
|
194
|
+
timer: (name: string) => () => void;
|
|
181
195
|
/**
|
|
182
196
|
* The metadata information
|
|
183
197
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"context.d.cts","names":[],"sources":["../../src/types/context.ts"],"mappings":";;;;;;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AK,IAAA,EACL,OAAA,GAAU,kBAAA,KACP,gBAAA,CAAiB,aAAA,CAAc,eAAA,GAAkB,IAAA;EAlBb;;;;;;EA0BzC,KAAA,QAAa,OAAA,CAAQ,kBAAA,CAAmB,eAAA;AAAA;AAAA,UAGzB,aAAA,6BACa,cAAA,GAAiB,cAAA,UAErC,OAAA,CAAQ,eAAA,GAAkB,eAAA;EAftB;;;EAmBZ,WAAA,EAAa,yBAAA;EAlBR;;;;;;EA0BL,MAAA,EAAQ,KAAA;EAzDR;;;;;;EAiEA,KAAA,QAAa,OAAA,CAAQ,aAAA,CAAc,eAAA;AAAA;AAAA,KAGzB,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
|
@@ -178,6 +178,20 @@ interface UnresolvedContext<TResolvedConfig extends ResolvedConfig = ResolvedCon
|
|
|
178
178
|
* A logging function for trace messages
|
|
179
179
|
*/
|
|
180
180
|
trace: (message: string | UnpluginMessage) => void;
|
|
181
|
+
/**
|
|
182
|
+
* A function to create a timer for measuring the duration of asynchronous operations
|
|
183
|
+
*
|
|
184
|
+
* @example
|
|
185
|
+
* ```ts
|
|
186
|
+
* const stopTimer = context.timer("Your Async Operation");
|
|
187
|
+
* await performAsyncOperation();
|
|
188
|
+
* stopTimer(); // "Your Async Operation completed in 123.45 milliseconds"
|
|
189
|
+
* ```
|
|
190
|
+
*
|
|
191
|
+
* @param name - The name of the timer.
|
|
192
|
+
* @returns A function that, when called, stops the timer and logs the duration.
|
|
193
|
+
*/
|
|
194
|
+
timer: (name: string) => () => void;
|
|
181
195
|
/**
|
|
182
196
|
* The metadata information
|
|
183
197
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"context.d.mts","names":[],"sources":["../../src/types/context.ts"],"mappings":";;;;;;;;;;;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AA,EACL,OAAA,GAAU,kBAAA,KACP,gBAAA,CAAiB,aAAA,CAAc,eAAA,GAAkB,IAAA;EAlBb;;;;;;EA0BzC,KAAA,QAAa,OAAA,CAAQ,kBAAA,CAAmB,eAAA;AAAA;AAAA,UAGzB,aAAA,6BACa,cAAA,GAAiB,cAAA,UAErC,OAAA,CAAQ,eAAA,GAAkB,eAAA;EAftB;;;EAmBZ,WAAA,EAAa,yBAAA;EAlBR;;;;;;EA0BL,MAAA,EAAQ,KAAA;EAzDR;;;;;;EAiEA,KAAA,QAAa,OAAA,CAAQ,aAAA,CAAc,eAAA;AAAA;AAAA,KAGzB,kBAAA,yBACc,cAAA,GAAiB,cAAA,IACvC,oBAAA,GAAuB,aAAA,CAAc,eAAA;AAAA,KAE7B,wBAAA,kBAA0C,aAAA,IACpD,oBAAA,GAAuB,QAAA;AAAA"}
|
package/dist/types/index.d.cts
CHANGED
|
@@ -6,4 +6,4 @@ import { BasePlugin, HookFunctions, Hooks, Plugin, PluginHook, PluginHookFields,
|
|
|
6
6
|
import { CallHookOptions, HookListOrders, HooksList, HooksListItem, InferHookFunction, InferHookParameters, InferHookReturnType, InferHookThisType, __ΩCallHookOptions, __ΩHookListOrders, __ΩHooksList, __ΩHooksListItem, __ΩInferHookFunction, __ΩInferHookParameters, __ΩInferHookReturnType, __ΩInferHookThisType } from "./hooks.cjs";
|
|
7
7
|
import { DeepkitOptions, ParsedTypeScriptConfig, RawReflectionMode, ReflectionLevel, ReflectionMode, TSCompilerOptions, TSConfig, __ΩDeepkitOptions, __ΩParsedTypeScriptConfig, __ΩRawReflectionMode, __ΩReflectionLevel, __ΩReflectionMode, __ΩTSCompilerOptions, __ΩTSConfig } from "./tsconfig.cjs";
|
|
8
8
|
import { APIContext, BuildPluginContext, Context, EmitEntryOptions, EmitOptions, EnvironmentContext, EnvironmentContextPlugin, FetchOptions, InitContextOptions, MetaInfo, ParseOptions, PluginContext, ResolveResult, Resolver, SelectHookResult, SelectHookResultItem, SelectHooksOptions, SourceFile, TransformResult, UnimportContext, UnresolvedContext, WithUnpluginBuildContext, WorkerProcess, __ΩAPIContext, __ΩBuildPluginContext, __ΩContext, __ΩEmitEntryOptions, __ΩEmitOptions, __ΩEnvironmentContext, __ΩEnvironmentContextPlugin, __ΩFetchOptions, __ΩInitContextOptions, __ΩMetaInfo, __ΩParseOptions, __ΩPluginContext, __ΩResolveResult, __ΩResolver, __ΩSelectHookResult, __ΩSelectHookResultItem, __ΩSelectHooksOptions, __ΩSourceFile, __ΩTransformResult, __ΩUnimportContext, __ΩUnresolvedContext, __ΩWithUnpluginBuildContext, __ΩWorkerProcess } from "./context.cjs";
|
|
9
|
-
import { AnyOutputUserConfig, AnyUserConfig, BuildInlineConfig, CleanInlineConfig, Config, ConfigEnv, CopyConfig, CopyResolvedConfig, DeployInlineConfig, DocsInlineConfig, EnvironmentConfig, EnvironmentResolvedConfig, InitialUserConfig, InlineConfig, LintInlineConfig, LogFn, LogLevel, Logger, NewInlineConfig, OutputConfig, OutputResolvedConfig, ParsedUserConfig, PartialPlugin, PartialPluginFactory, PluginConfig, PluginConfigObject, PluginConfigTuple, PluginFactory, PowerlinesCommand, PrepareInlineConfig, ProjectType, ResolveConfig, ResolveResolvedConfig, ResolvedAssetGlob, ResolvedConfig, ResolvedEntryTypeDefinition, TypesInlineConfig, UserConfig, UserConfigFn, WorkspaceConfig, __ΩAnyOutputUserConfig, __ΩAnyUserConfig, __ΩBuildInlineConfig, __ΩCleanInlineConfig, __ΩConfig, __ΩConfigEnv, __ΩCopyConfig, __ΩCopyResolvedConfig, __ΩDeployInlineConfig, __ΩDocsInlineConfig, __ΩEnvironmentConfig, __ΩEnvironmentResolvedConfig, __ΩInitialUserConfig, __ΩInlineConfig, __ΩLintInlineConfig, __ΩLogFn, __ΩLogLevel, __ΩLogger, __ΩNewInlineConfig, __ΩOutputConfig, __ΩOutputResolvedConfig, __ΩParsedUserConfig, __ΩPartialPlugin, __ΩPartialPluginFactory, __ΩPluginConfig, __ΩPluginConfigObject, __ΩPluginConfigTuple, __ΩPluginFactory, __ΩPowerlinesCommand, __ΩPrepareInlineConfig, __ΩProjectType, __ΩResolveConfig, __ΩResolveResolvedConfig, __ΩResolvedAssetGlob, __ΩResolvedConfig, __ΩResolvedEntryTypeDefinition, __ΩTypesInlineConfig, __ΩUserConfig, __ΩUserConfigFn, __ΩWorkspaceConfig } from "./config.cjs";
|
|
9
|
+
import { AnyOutputUserConfig, AnyUserConfig, BuildInlineConfig, CleanInlineConfig, Config, ConfigEnv, CopyConfig, CopyResolvedConfig, DeployInlineConfig, DocsInlineConfig, EnvironmentConfig, EnvironmentResolvedConfig, InitialUserConfig, InlineConfig, LintInlineConfig, LogFn, LogLevel, LogLevelConfig, Logger, NewInlineConfig, OutputConfig, OutputResolvedConfig, ParsedUserConfig, PartialPlugin, PartialPluginFactory, PluginConfig, PluginConfigObject, PluginConfigTuple, PluginFactory, PowerlinesCommand, PrepareInlineConfig, ProjectType, ResolveConfig, ResolveResolvedConfig, ResolvedAssetGlob, ResolvedConfig, ResolvedEntryTypeDefinition, TypesInlineConfig, UserConfig, UserConfigFn, WorkspaceConfig, __ΩAnyOutputUserConfig, __ΩAnyUserConfig, __ΩBuildInlineConfig, __ΩCleanInlineConfig, __ΩConfig, __ΩConfigEnv, __ΩCopyConfig, __ΩCopyResolvedConfig, __ΩDeployInlineConfig, __ΩDocsInlineConfig, __ΩEnvironmentConfig, __ΩEnvironmentResolvedConfig, __ΩInitialUserConfig, __ΩInlineConfig, __ΩLintInlineConfig, __ΩLogFn, __ΩLogLevel, __ΩLogLevelConfig, __ΩLogger, __ΩNewInlineConfig, __ΩOutputConfig, __ΩOutputResolvedConfig, __ΩParsedUserConfig, __ΩPartialPlugin, __ΩPartialPluginFactory, __ΩPluginConfig, __ΩPluginConfigObject, __ΩPluginConfigTuple, __ΩPluginFactory, __ΩPowerlinesCommand, __ΩPrepareInlineConfig, __ΩProjectType, __ΩResolveConfig, __ΩResolveResolvedConfig, __ΩResolvedAssetGlob, __ΩResolvedConfig, __ΩResolvedEntryTypeDefinition, __ΩTypesInlineConfig, __ΩUserConfig, __ΩUserConfigFn, __ΩWorkspaceConfig } from "./config.cjs";
|
package/dist/types/index.d.mts
CHANGED
|
@@ -6,4 +6,4 @@ import { BasePlugin, HookFunctions, Hooks, Plugin, PluginHook, PluginHookFields,
|
|
|
6
6
|
import { CallHookOptions, HookListOrders, HooksList, HooksListItem, InferHookFunction, InferHookParameters, InferHookReturnType, InferHookThisType, __ΩCallHookOptions, __ΩHookListOrders, __ΩHooksList, __ΩHooksListItem, __ΩInferHookFunction, __ΩInferHookParameters, __ΩInferHookReturnType, __ΩInferHookThisType } from "./hooks.mjs";
|
|
7
7
|
import { DeepkitOptions, ParsedTypeScriptConfig, RawReflectionMode, ReflectionLevel, ReflectionMode, TSCompilerOptions, TSConfig, __ΩDeepkitOptions, __ΩParsedTypeScriptConfig, __ΩRawReflectionMode, __ΩReflectionLevel, __ΩReflectionMode, __ΩTSCompilerOptions, __ΩTSConfig } from "./tsconfig.mjs";
|
|
8
8
|
import { APIContext, BuildPluginContext, Context, EmitEntryOptions, EmitOptions, EnvironmentContext, EnvironmentContextPlugin, FetchOptions, InitContextOptions, MetaInfo, ParseOptions, PluginContext, ResolveResult, Resolver, SelectHookResult, SelectHookResultItem, SelectHooksOptions, SourceFile, TransformResult, UnimportContext, UnresolvedContext, WithUnpluginBuildContext, WorkerProcess, __ΩAPIContext, __ΩBuildPluginContext, __ΩContext, __ΩEmitEntryOptions, __ΩEmitOptions, __ΩEnvironmentContext, __ΩEnvironmentContextPlugin, __ΩFetchOptions, __ΩInitContextOptions, __ΩMetaInfo, __ΩParseOptions, __ΩPluginContext, __ΩResolveResult, __ΩResolver, __ΩSelectHookResult, __ΩSelectHookResultItem, __ΩSelectHooksOptions, __ΩSourceFile, __ΩTransformResult, __ΩUnimportContext, __ΩUnresolvedContext, __ΩWithUnpluginBuildContext, __ΩWorkerProcess } from "./context.mjs";
|
|
9
|
-
import { AnyOutputUserConfig, AnyUserConfig, BuildInlineConfig, CleanInlineConfig, Config, ConfigEnv, CopyConfig, CopyResolvedConfig, DeployInlineConfig, DocsInlineConfig, EnvironmentConfig, EnvironmentResolvedConfig, InitialUserConfig, InlineConfig, LintInlineConfig, LogFn, LogLevel, Logger, NewInlineConfig, OutputConfig, OutputResolvedConfig, ParsedUserConfig, PartialPlugin, PartialPluginFactory, PluginConfig, PluginConfigObject, PluginConfigTuple, PluginFactory, PowerlinesCommand, PrepareInlineConfig, ProjectType, ResolveConfig, ResolveResolvedConfig, ResolvedAssetGlob, ResolvedConfig, ResolvedEntryTypeDefinition, TypesInlineConfig, UserConfig, UserConfigFn, WorkspaceConfig, __ΩAnyOutputUserConfig, __ΩAnyUserConfig, __ΩBuildInlineConfig, __ΩCleanInlineConfig, __ΩConfig, __ΩConfigEnv, __ΩCopyConfig, __ΩCopyResolvedConfig, __ΩDeployInlineConfig, __ΩDocsInlineConfig, __ΩEnvironmentConfig, __ΩEnvironmentResolvedConfig, __ΩInitialUserConfig, __ΩInlineConfig, __ΩLintInlineConfig, __ΩLogFn, __ΩLogLevel, __ΩLogger, __ΩNewInlineConfig, __ΩOutputConfig, __ΩOutputResolvedConfig, __ΩParsedUserConfig, __ΩPartialPlugin, __ΩPartialPluginFactory, __ΩPluginConfig, __ΩPluginConfigObject, __ΩPluginConfigTuple, __ΩPluginFactory, __ΩPowerlinesCommand, __ΩPrepareInlineConfig, __ΩProjectType, __ΩResolveConfig, __ΩResolveResolvedConfig, __ΩResolvedAssetGlob, __ΩResolvedConfig, __ΩResolvedEntryTypeDefinition, __ΩTypesInlineConfig, __ΩUserConfig, __ΩUserConfigFn, __ΩWorkspaceConfig } from "./config.mjs";
|
|
9
|
+
import { AnyOutputUserConfig, AnyUserConfig, BuildInlineConfig, CleanInlineConfig, Config, ConfigEnv, CopyConfig, CopyResolvedConfig, DeployInlineConfig, DocsInlineConfig, EnvironmentConfig, EnvironmentResolvedConfig, InitialUserConfig, InlineConfig, LintInlineConfig, LogFn, LogLevel, LogLevelConfig, Logger, NewInlineConfig, OutputConfig, OutputResolvedConfig, ParsedUserConfig, PartialPlugin, PartialPluginFactory, PluginConfig, PluginConfigObject, PluginConfigTuple, PluginFactory, PowerlinesCommand, PrepareInlineConfig, ProjectType, ResolveConfig, ResolveResolvedConfig, ResolvedAssetGlob, ResolvedConfig, ResolvedEntryTypeDefinition, TypesInlineConfig, UserConfig, UserConfigFn, WorkspaceConfig, __ΩAnyOutputUserConfig, __ΩAnyUserConfig, __ΩBuildInlineConfig, __ΩCleanInlineConfig, __ΩConfig, __ΩConfigEnv, __ΩCopyConfig, __ΩCopyResolvedConfig, __ΩDeployInlineConfig, __ΩDocsInlineConfig, __ΩEnvironmentConfig, __ΩEnvironmentResolvedConfig, __ΩInitialUserConfig, __ΩInlineConfig, __ΩLintInlineConfig, __ΩLogFn, __ΩLogLevel, __ΩLogLevelConfig, __ΩLogger, __ΩNewInlineConfig, __ΩOutputConfig, __ΩOutputResolvedConfig, __ΩParsedUserConfig, __ΩPartialPlugin, __ΩPartialPluginFactory, __ΩPluginConfig, __ΩPluginConfigObject, __ΩPluginConfigTuple, __ΩPluginFactory, __ΩPowerlinesCommand, __ΩPrepareInlineConfig, __ΩProjectType, __ΩResolveConfig, __ΩResolveResolvedConfig, __ΩResolvedAssetGlob, __ΩResolvedConfig, __ΩResolvedEntryTypeDefinition, __ΩTypesInlineConfig, __ΩUserConfig, __ΩUserConfigFn, __ΩWorkspaceConfig } from "./config.mjs";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@powerlines/core",
|
|
3
|
-
"version": "0.13.
|
|
3
|
+
"version": "0.13.7",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "An internal core package for Powerlines - please use the `powerlines` package for public usage.",
|
|
6
6
|
"homepage": "https://stormsoftware.com",
|
|
@@ -493,8 +493,8 @@
|
|
|
493
493
|
"types": "./dist/index.d.cts",
|
|
494
494
|
"files": ["dist/**/*", "files/**/*", "schemas/**/*"],
|
|
495
495
|
"dependencies": {
|
|
496
|
-
"@storm-software/config": "^1.137.
|
|
497
|
-
"@storm-software/config-tools": "^1.189.
|
|
496
|
+
"@storm-software/config": "^1.137.29",
|
|
497
|
+
"@storm-software/config-tools": "^1.189.75",
|
|
498
498
|
"@stryke/convert": "^0.6.58",
|
|
499
499
|
"@stryke/env": "^0.20.83",
|
|
500
500
|
"@stryke/fs": "^0.33.66",
|
|
@@ -508,24 +508,24 @@
|
|
|
508
508
|
"c12": "^3.3.4",
|
|
509
509
|
"chalk": "5.6.2",
|
|
510
510
|
"compatx": "^0.2.0",
|
|
511
|
-
"defu": "^6.1.
|
|
511
|
+
"defu": "^6.1.7",
|
|
512
512
|
"diff-match-patch": "^1.0.5",
|
|
513
513
|
"jiti": "^2.6.1",
|
|
514
514
|
"magic-string": "^0.30.21",
|
|
515
|
-
"prettier": "^3.8.
|
|
515
|
+
"prettier": "^3.8.2",
|
|
516
516
|
"unplugin": "^3.0.0",
|
|
517
517
|
"unplugin-combine": "^2.3.0"
|
|
518
518
|
},
|
|
519
519
|
"devDependencies": {
|
|
520
|
-
"@storm-software/testing-tools": "^1.119.
|
|
520
|
+
"@storm-software/testing-tools": "^1.119.150",
|
|
521
521
|
"@stryke/types": "^0.11.3",
|
|
522
522
|
"@types/diff-match-patch": "^1.0.36",
|
|
523
|
-
"@types/node": "^25.
|
|
523
|
+
"@types/node": "^25.6.0",
|
|
524
524
|
"@types/semver": "^7.7.1",
|
|
525
525
|
"prettier-plugin-organize-imports": "^4.3.0",
|
|
526
526
|
"tsdown": "^0.21.7",
|
|
527
527
|
"typescript": "^5.9.3"
|
|
528
528
|
},
|
|
529
529
|
"publishConfig": { "access": "public" },
|
|
530
|
-
"gitHead": "
|
|
530
|
+
"gitHead": "0930e21b75080a208112efde05ca6a1ff2595b15"
|
|
531
531
|
}
|