@powerlines/core 0.45.2 → 0.46.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/constants/virtual-modules.cjs +4 -2
- package/dist/constants/virtual-modules.d.cts +1 -1
- package/dist/constants/virtual-modules.d.cts.map +1 -1
- package/dist/constants/virtual-modules.d.mts +1 -1
- package/dist/constants/virtual-modules.d.mts.map +1 -1
- package/dist/constants/virtual-modules.mjs +4 -2
- package/dist/constants/virtual-modules.mjs.map +1 -1
- package/dist/index.d.cts +5 -5
- package/dist/index.d.mts +5 -5
- package/dist/lib/config.d.cts +2 -1
- package/dist/lib/config.d.cts.map +1 -1
- package/dist/lib/config.d.mts +2 -1
- package/dist/lib/config.d.mts.map +1 -1
- package/dist/lib/config.mjs.map +1 -1
- package/dist/lib/unplugin/module-resolution.cjs +10 -10
- package/dist/lib/unplugin/module-resolution.mjs +10 -10
- package/dist/lib/unplugin/module-resolution.mjs.map +1 -1
- package/dist/lib/unplugin/plugin.cjs +6 -6
- package/dist/lib/unplugin/plugin.mjs +6 -6
- package/dist/lib/unplugin/plugin.mjs.map +1 -1
- package/dist/plugin-utils/helpers.d.cts +10 -9
- package/dist/plugin-utils/helpers.d.cts.map +1 -1
- package/dist/plugin-utils/helpers.d.mts +10 -9
- package/dist/plugin-utils/helpers.d.mts.map +1 -1
- package/dist/plugin-utils/paths.cjs +6 -2
- package/dist/plugin-utils/paths.mjs +6 -2
- package/dist/plugin-utils/paths.mjs.map +1 -1
- package/dist/types/_internal.d.cts +3 -18
- package/dist/types/_internal.d.cts.map +1 -1
- package/dist/types/_internal.d.mts +3 -18
- package/dist/types/_internal.d.mts.map +1 -1
- package/dist/types/api.d.cts +4 -3
- package/dist/types/api.d.cts.map +1 -1
- package/dist/types/api.d.mts +4 -3
- package/dist/types/api.d.mts.map +1 -1
- package/dist/types/config.d.cts +103 -70
- package/dist/types/config.d.cts.map +1 -1
- package/dist/types/config.d.mts +103 -70
- package/dist/types/config.d.mts.map +1 -1
- package/dist/types/context.d.cts +57 -68
- package/dist/types/context.d.cts.map +1 -1
- package/dist/types/context.d.mts +57 -68
- package/dist/types/context.d.mts.map +1 -1
- package/dist/types/index.d.cts +4 -4
- package/dist/types/index.d.mts +4 -4
- package/dist/types/plugin.d.cts +3 -6
- package/dist/types/plugin.d.cts.map +1 -1
- package/dist/types/plugin.d.mts +3 -6
- package/dist/types/plugin.d.mts.map +1 -1
- package/dist/types/unplugin.d.cts +9 -9
- package/dist/types/unplugin.d.cts.map +1 -1
- package/dist/types/unplugin.d.mts +9 -9
- package/dist/types/unplugin.d.mts.map +1 -1
- package/package.json +14 -13
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"context.d.cts","names":[],"sources":["../../src/types/context.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"context.d.cts","names":[],"sources":["../../src/types/context.ts"],"mappings":";;;;;;;;;;;;;;;;;;;;UAyDiB,QAAA;EAAA;;;EAIf,QAAA;EAAA;;;EAKA,OAAA;EAeA;;;EAVA,SAAA;EAkBe;;;EAbf,SAAA;EAagC;;;EARhC,QAAA;EASY;AAGd;;EAPE,UAAA;AAAA;AAAA,UAGe,QAAA,SAAiB,IAAA;EAChC,MAAA,EAAQ,IAAA;AAAA;AAAA,UAGO,iBAAA;EACf,IAAA;EACA,GAAA,EAAK,SAAA;AAAA;;;;UAMU,UAAA;EAST;;;EALN,EAAA;EAewB;;AAG1B;EAbE,IAAA,EAAM,WAAA;;;;EAKN,GAAA;EAUwB;;;EALxB,MAAA,GAAS,iBAAA;AAAA;AAAA,KAGC,eAAA,GAAkB,IAAA,CAAK,QAAA;EACjC,WAAA,QAAmB,OAAA;EACnB,aAAA,GAAgB,MAAA,EAAQ,UAAA,KAAe,OAAA,CAAQ,UAAA;EAC/C,qBAAA,QAA6B,OAAA;AAAA;AAAA,UAGd,kBAAA;EACf,KAAA;AAAA;;;;UAMe,kBAAA;EAVqB;;AAGtC;;;EAaE,cAAA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veOptions, VirtualFile, VirtualFileSystemInterface, WriteOptions } from "./fs.mjs";
|
|
2
1
|
import { Plugin } from "./plugin.mjs";
|
|
3
2
|
import { HooksList, HooksListItem } from "./hooks.mjs";
|
|
3
|
+
import { API } from "./api.mjs";
|
|
4
|
+
import { ResolveOptions, VirtualFile, VirtualFileSystemInterface, WriteOptions } from "./fs.mjs";
|
|
4
5
|
import { LogFn, LogLevelResolvedConfig, LogMessage, Logger, LoggerOptions } from "./logging.mjs";
|
|
5
6
|
import { ParsedTypeScriptConfig } from "./tsconfig.mjs";
|
|
6
|
-
import { EngineOptions, EnvironmentResolvedConfig, ExecutionOptions,
|
|
7
|
+
import { EngineOptions, EnvironmentResolvedConfig, ExecutionOptions, ParsedUserConfig, ResolvedConfig, ResolvedEntryTypeDefinition, UserConfig } from "./config.mjs";
|
|
7
8
|
import { ExternalIdResult, UnpluginBuildContext } from "unplugin";
|
|
8
9
|
import MagicString, { SourceMap } from "magic-string";
|
|
10
|
+
import { DeepPartial, RequiredKeys } from "@stryke/types/base";
|
|
9
11
|
import { Jiti } from "jiti";
|
|
10
12
|
import { EnvPaths } from "@stryke/env/get-env-paths";
|
|
11
13
|
import { FetchRequestOptions } from "@stryke/http/fetch";
|
|
@@ -136,10 +138,6 @@ interface ResolveResult extends ExternalIdResult {
|
|
|
136
138
|
* This context provides the foundational structure for interacting with the Powerlines engine.
|
|
137
139
|
*/
|
|
138
140
|
interface BaseContext {
|
|
139
|
-
/**
|
|
140
|
-
* The options provided to the Powerlines process
|
|
141
|
-
*/
|
|
142
|
-
options: EngineOptions;
|
|
143
141
|
/**
|
|
144
142
|
* The timestamp when the context was initialized
|
|
145
143
|
*/
|
|
@@ -157,9 +155,9 @@ interface BaseContext {
|
|
|
157
155
|
*/
|
|
158
156
|
configFile: ParsedUserConfig;
|
|
159
157
|
/**
|
|
160
|
-
* The
|
|
158
|
+
* The options provided to the Powerlines process, resolved with default values and merged with any configuration provided by plugins or other sources. This is typically the final configuration used during the build process, but may also include additional options that are relevant to the context and its interactions with the Powerlines engine.
|
|
161
159
|
*/
|
|
162
|
-
|
|
160
|
+
options: RequiredKeys<EngineOptions, "mode" | "cwd" | "root" | "framework">;
|
|
163
161
|
/**
|
|
164
162
|
* The log level to use for the Powerlines processes.
|
|
165
163
|
*/
|
|
@@ -278,6 +276,23 @@ interface ExecutionState {
|
|
|
278
276
|
* This context is used during the execution of the Powerlines engine, providing access to the input user configurations.
|
|
279
277
|
*/
|
|
280
278
|
interface EngineContext extends BaseContext {
|
|
279
|
+
/**
|
|
280
|
+
* The initial options provided to the Powerlines process before any resolution or merging. This is typically the user configuration provided in the Powerlines configuration file, but may also include additional configuration options provided by plugins or other sources.
|
|
281
|
+
*/
|
|
282
|
+
readonly initialOptions: EngineOptions;
|
|
283
|
+
/**
|
|
284
|
+
* The options provided to the Powerlines process
|
|
285
|
+
*/
|
|
286
|
+
options: RequiredKeys<Omit<EngineOptions, "logLevel">, "name" | "root" | "cwd" | "mode" | "framework"> & {
|
|
287
|
+
/**
|
|
288
|
+
* The log level to use for logging messages during the build process. This can be a string indicating the log level or a more detailed configuration object that allows for specifying different log levels for different categories of logs.
|
|
289
|
+
*/
|
|
290
|
+
logLevel: LogLevelResolvedConfig;
|
|
291
|
+
};
|
|
292
|
+
/**
|
|
293
|
+
* The initial user configuration provided to the Powerlines process before any resolution or merging. This is typically the user configuration provided in the Powerlines configuration file, but may also include additional configuration options provided by plugins or other sources.
|
|
294
|
+
*/
|
|
295
|
+
readonly initialConfig: DeepPartial<UserConfig>;
|
|
281
296
|
/**
|
|
282
297
|
* A list of all command executions that will be run during the lifecycle of the engine
|
|
283
298
|
*/
|
|
@@ -291,22 +306,25 @@ interface EngineContext extends BaseContext {
|
|
|
291
306
|
*/
|
|
292
307
|
interface UnresolvedContext<TResolvedConfig extends ResolvedConfig = ResolvedConfig> extends BaseContext {
|
|
293
308
|
/**
|
|
294
|
-
* The options provided to the Powerlines process
|
|
295
|
-
*/
|
|
296
|
-
options: ExecutionOptions;
|
|
297
|
-
/**
|
|
298
|
-
* The input options used to initialize the context, which may be used when cloning the context to ensure the same configuration is applied to the new context
|
|
309
|
+
* The options provided to the Powerlines process, resolved with default values and merged with any configuration provided by plugins or other sources. This is typically the final configuration used during the build process, but may also include additional options that are relevant to the context and its interactions with the Powerlines engine.
|
|
299
310
|
*/
|
|
300
|
-
|
|
301
|
-
/**
|
|
302
|
-
* The initial configuration provided when initializing the context, which may be used during the setup process to ensure that the configuration is properly merged and applied to the context. This is typically the user configuration provided in the Powerlines configuration file, but may also include additional configuration options provided by plugins or other sources.
|
|
303
|
-
*/
|
|
304
|
-
initialConfig: InitialConfig<TResolvedConfig["userConfig"]>;
|
|
311
|
+
options: RequiredKeys<ExecutionOptions, "mode" | "cwd" | "root" | "framework" | "logLevel">;
|
|
305
312
|
/**
|
|
306
313
|
* An object containing the options provided to Powerlines
|
|
307
314
|
*/
|
|
308
|
-
config: Omit<TResolvedConfig["userConfig"], "output"> & Required<Pick<TResolvedConfig["userConfig"], "output">> & {
|
|
315
|
+
config: Omit<TResolvedConfig["userConfig"], "output"> & Required<Pick<TResolvedConfig["userConfig"], "output">> & Pick<TResolvedConfig, "cwd" | "root" | "mode" | "framework" | "configFile" | "name"> & {
|
|
316
|
+
/**
|
|
317
|
+
* The output configuration options for the Powerlines process, which may include settings related to the output directory, file naming conventions, and other options that affect how the compiled output is generated and structured. This is typically derived from the user configuration but may also include additional options provided by plugins or other sources.
|
|
318
|
+
*/
|
|
309
319
|
output: TResolvedConfig["output"];
|
|
320
|
+
/**
|
|
321
|
+
* The original configuration options that were provided by the user to the Powerlines process, which may be used during the configuration resolution process to ensure that the final configuration is properly merged and applied to the context. This is typically the user configuration provided in the Powerlines configuration file, but may also include additional configuration options provided by plugins or other sources.
|
|
322
|
+
*/
|
|
323
|
+
readonly initialConfig: TResolvedConfig["initialConfig"];
|
|
324
|
+
/**
|
|
325
|
+
* The configuration options that were provided inline to the Powerlines CLI.
|
|
326
|
+
*/
|
|
327
|
+
readonly inlineConfig: TResolvedConfig["inlineConfig"];
|
|
310
328
|
};
|
|
311
329
|
/**
|
|
312
330
|
* The metadata information
|
|
@@ -551,17 +569,6 @@ type Context<TResolvedConfig extends ResolvedConfig = ResolvedConfig> = Omit<Unr
|
|
|
551
569
|
* The fully resolved Powerlines configuration
|
|
552
570
|
*/
|
|
553
571
|
config: TResolvedConfig;
|
|
554
|
-
/**
|
|
555
|
-
* Initialize the context with the provided configuration options
|
|
556
|
-
*/
|
|
557
|
-
setup: () => Promise<void>;
|
|
558
|
-
/**
|
|
559
|
-
* A function to create a deep clone of the context
|
|
560
|
-
*
|
|
561
|
-
* @remarks
|
|
562
|
-
* This function is used to create a copy of the context for a specific environment, allowing for environment-specific modifications without affecting the global context.
|
|
563
|
-
*/
|
|
564
|
-
clone: () => Promise<Context<TResolvedConfig>>;
|
|
565
572
|
};
|
|
566
573
|
interface ExecutionContext<TResolvedConfig extends ResolvedConfig = ResolvedConfig> extends Context<TResolvedConfig> {
|
|
567
574
|
/**
|
|
@@ -575,14 +582,14 @@ interface ExecutionContext<TResolvedConfig extends ResolvedConfig = ResolvedConf
|
|
|
575
582
|
* This is a record of plugin identifiers to their respective options. This field is populated by the Powerlines engine during both plugin initialization and the `init` command.
|
|
576
583
|
*/
|
|
577
584
|
plugins: Plugin<PluginContext<TResolvedConfig>>[];
|
|
578
|
-
/**
|
|
579
|
-
* A function to add a plugin to the context and update the configuration options
|
|
580
|
-
*/
|
|
581
|
-
addPlugin: (plugin: Plugin<PluginContext<TResolvedConfig>>) => Promise<void>;
|
|
582
585
|
/**
|
|
583
586
|
* A table for storing the current context for each configured environment
|
|
584
587
|
*/
|
|
585
588
|
environments: Record<string, EnvironmentContext<TResolvedConfig>>;
|
|
589
|
+
/**
|
|
590
|
+
* A function to add a plugin to the context and update the configuration options
|
|
591
|
+
*/
|
|
592
|
+
addPlugin: (plugin: Plugin<PluginContext<TResolvedConfig>>) => Promise<void>;
|
|
586
593
|
/**
|
|
587
594
|
* Retrieves the context for a specific environment by name
|
|
588
595
|
*
|
|
@@ -632,20 +639,13 @@ interface ExecutionContext<TResolvedConfig extends ResolvedConfig = ResolvedConf
|
|
|
632
639
|
* @param environment - The environment configuration to use.
|
|
633
640
|
* @returns A new context instance with the updated environment.
|
|
634
641
|
*/
|
|
635
|
-
|
|
642
|
+
createEnvironment: (environment: EnvironmentResolvedConfig<TResolvedConfig>["environment"]) => Promise<EnvironmentContext<TResolvedConfig>>;
|
|
636
643
|
/**
|
|
637
644
|
* A function to merge all configured environments into a single context
|
|
638
645
|
*
|
|
639
646
|
* @returns A promise that resolves to the merged environment context.
|
|
640
647
|
*/
|
|
641
648
|
toEnvironment: () => Promise<EnvironmentContext<TResolvedConfig>>;
|
|
642
|
-
/**
|
|
643
|
-
* A function to create a deep clone of the context
|
|
644
|
-
*
|
|
645
|
-
* @remarks
|
|
646
|
-
* This function is used to create a copy of the context for a specific environment, allowing for environment-specific modifications without affecting the global context.
|
|
647
|
-
*/
|
|
648
|
-
clone: () => Promise<ExecutionContext<TResolvedConfig>>;
|
|
649
649
|
}
|
|
650
650
|
interface EnvironmentContextPlugin<TResolvedConfig extends ResolvedConfig = ResolvedConfig> {
|
|
651
651
|
/**
|
|
@@ -668,11 +668,11 @@ type SelectHookResultItem<TContext extends PluginContext, TKey extends string> =
|
|
|
668
668
|
context: TContext;
|
|
669
669
|
};
|
|
670
670
|
type SelectHookResult<TContext extends PluginContext, TKey extends string> = SelectHookResultItem<TContext, TKey>[];
|
|
671
|
-
interface EnvironmentContext<TResolvedConfig extends ResolvedConfig = ResolvedConfig> extends Context<TResolvedConfig
|
|
671
|
+
interface EnvironmentContext<TResolvedConfig extends ResolvedConfig = ResolvedConfig> extends Context<EnvironmentResolvedConfig<TResolvedConfig>> {
|
|
672
672
|
/**
|
|
673
673
|
* The unique identifier of the environment associated with this context, which can be used for logging and other purposes to distinguish between different environments in the same process.
|
|
674
674
|
*/
|
|
675
|
-
id: string;
|
|
675
|
+
readonly id: string;
|
|
676
676
|
/**
|
|
677
677
|
* The expected plugins options for the Powerlines project.
|
|
678
678
|
*
|
|
@@ -680,46 +680,35 @@ interface EnvironmentContext<TResolvedConfig extends ResolvedConfig = ResolvedCo
|
|
|
680
680
|
* This is a record of plugin identifiers to their respective options. This field is populated by the Powerlines engine during both plugin initialization and the `init` command.
|
|
681
681
|
*/
|
|
682
682
|
plugins: EnvironmentContextPlugin<TResolvedConfig>[];
|
|
683
|
-
/**
|
|
684
|
-
* A function to add a plugin to the context and update the configuration options
|
|
685
|
-
*/
|
|
686
|
-
addPlugin: (plugin: Plugin<PluginContext<TResolvedConfig>>) => Promise<void>;
|
|
687
|
-
/**
|
|
688
|
-
* The environment specific resolved configuration
|
|
689
|
-
*/
|
|
690
|
-
environment: EnvironmentResolvedConfig;
|
|
691
683
|
/**
|
|
692
684
|
* A table holding references to hook functions registered by plugins
|
|
693
685
|
*/
|
|
694
686
|
hooks: HooksList<PluginContext<TResolvedConfig>>;
|
|
695
687
|
/**
|
|
696
|
-
*
|
|
688
|
+
* A function to add a plugin to the context and update the configuration options
|
|
697
689
|
*/
|
|
698
|
-
|
|
690
|
+
addPlugin: (plugin: Plugin<PluginContext<TResolvedConfig>>) => Promise<void>;
|
|
699
691
|
/**
|
|
700
|
-
*
|
|
701
|
-
*
|
|
702
|
-
* @remarks
|
|
703
|
-
* This function is used to create a copy of the context for a specific environment, allowing for environment-specific modifications without affecting the global context.
|
|
692
|
+
* Retrieves the hook handlers for a specific hook name
|
|
704
693
|
*/
|
|
705
|
-
|
|
694
|
+
selectHooks: <TKey extends string>(key: TKey, options?: SelectHooksOptions) => SelectHookResult<PluginContext<TResolvedConfig>, TKey>;
|
|
706
695
|
}
|
|
707
|
-
interface PluginContext<out TResolvedConfig extends ResolvedConfig = ResolvedConfig> extends Context<TResolvedConfig
|
|
696
|
+
interface PluginContext<out TResolvedConfig extends ResolvedConfig = ResolvedConfig, TApi extends API<any> = API<any>> extends Context<EnvironmentResolvedConfig<TResolvedConfig>> {
|
|
708
697
|
/**
|
|
709
698
|
* The unique identifier of the plugin associated with this context, which can be used for logging and other purposes to distinguish between different plugins in the same process.
|
|
710
699
|
*/
|
|
711
|
-
id: string;
|
|
712
|
-
/**
|
|
713
|
-
* The environment specific resolved configuration
|
|
714
|
-
*/
|
|
715
|
-
environment: EnvironmentResolvedConfig;
|
|
700
|
+
readonly id: string;
|
|
716
701
|
/**
|
|
717
|
-
*
|
|
702
|
+
* The API instance available to the plugin during execution, which provides access to the shared context and the ability to call plugin hooks. This API is specific to the plugin and environment, allowing for environment-specific interactions with the Powerlines engine.
|
|
718
703
|
*
|
|
719
704
|
* @remarks
|
|
720
|
-
*
|
|
705
|
+
* The API instance provided in the plugin context may include additional functionality specific to command execution, and it extends the base API with any additional methods or properties that are relevant to the plugin's interactions with the Powerlines engine.
|
|
706
|
+
*/
|
|
707
|
+
readonly api: TApi;
|
|
708
|
+
/**
|
|
709
|
+
* The context for the environment associated with this plugin context, which provides access to the Powerlines engine and other utilities for interacting with the build process. This context is specific to the plugin and environment, allowing for environment-specific modifications without affecting the global context.
|
|
721
710
|
*/
|
|
722
|
-
|
|
711
|
+
readonly environment: EnvironmentContext;
|
|
723
712
|
}
|
|
724
713
|
type BuildPluginContext<TResolvedConfig extends ResolvedConfig = ResolvedConfig> = UnpluginBuildContext & PluginContext<TResolvedConfig>;
|
|
725
714
|
type WithUnpluginBuildContext<TContext extends PluginContext> = UnpluginBuildContext & TContext;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"context.d.mts","names":[],"sources":["../../src/types/context.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"context.d.mts","names":[],"sources":["../../src/types/context.ts"],"mappings":";;;;;;;;;;;;;;;;;;;;UAyDiB,QAAA;EAAA;;;EAIf,QAAA;EAAA;;;EAKA,OAAA;EAeA;;;EAVA,SAAA;EAkBe;;;EAbf,SAAA;EAagC;;;EARhC,QAAA;EASY;AAGd;;EAPE,UAAA;AAAA;AAAA,UAGe,QA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AAA,CAAc,eAAA,GAAkB,IAAA;AAAA;AAAA,UAGvC,aAAA,6BACa,cAAA,GAAiB,cAAA,eAChC,GAAA,QAAW,GAAA,eAChB,OAAA,CAAQ,yBAAA,CAA0B,eAAA;EAHd;;;EAAA,SAOnB,EAAA;EALI;;;;;;EAAA,SAaJ,GAAA,EAAK,IAAA;EAZC;;;EAAA,SAiBN,WAAA,EAAa,kBAAA;AAAA;AAAA,KAGZ,kBAAA,yBACc,cAAA,GAAiB,cAAA,IACvC,oBAAA,GAAuB,aAAA,CAAc,eAAA;AAAA,KAE7B,wBAAA,kBAA0C,aAAA,IACpD,oBAAA,GAAuB,QAAA;AAAA"}
|
package/dist/types/index.d.cts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { ResolveOptions, StorageAdapter, StoragePort, StoragePreset, VirtualFile, VirtualFileData, VirtualFileExtension, VirtualFileMetadata, VirtualFileSystemInterface, WriteData, WriteOptions, __ΩResolveOptions, __ΩStorageAdapter, __ΩStoragePort, __ΩStoragePreset, __ΩVirtualFile, __ΩVirtualFileData, __ΩVirtualFileExtension, __ΩVirtualFileMetadata, __ΩVirtualFileSystemInterface, __ΩWriteData, __ΩWriteOptions } from "./fs.cjs";
|
|
2
1
|
import { BaseCommandType, CommandType, Commands, __ΩBaseCommandType, __ΩCommandType, __ΩCommands } from "./commands.cjs";
|
|
3
|
-
import { WorkerProcess, __ΩWorkerProcess } from "./utils.cjs";
|
|
4
|
-
import { API, APIFunctions, BaseAPIFunctions, Engine, Execution, ExecutionWorkerParams, ExecutionWorkerProcess, SupportedCommands, __ΩAPI, __ΩAPIFunctions, __ΩBaseAPIFunctions, __ΩEngine, __ΩExecution, __ΩExecutionWorkerParams, __ΩExecutionWorkerProcess, __ΩSupportedCommands } from "./api.cjs";
|
|
5
2
|
import { BuilderVariant, InferUnpluginOptions, InferUnpluginVariant, UnpluginAsyncFactory, UnpluginBuilderVariant, UnpluginFactory, UnpluginHookFunctions, UnpluginInitialConfig, UnpluginOptions, __ΩBuilderVariant, __ΩInferUnpluginOptions, __ΩInferUnpluginVariant, __ΩUnpluginAsyncFactory, __ΩUnpluginBuilderVariant, __ΩUnpluginFactory, __ΩUnpluginHookFunctions, __ΩUnpluginInitialConfig, __ΩUnpluginOptions } from "./unplugin.cjs";
|
|
6
3
|
import { BasePlugin, HookFunctions, Hooks, Plugin, PluginHook, PluginHookFields, PluginHookObject, PluginHooks, PluginNonHookFields, TypesResult, __ΩBasePlugin, __ΩHookFunctions, __ΩHooks, __ΩPlugin, __ΩPluginHook, __ΩPluginHookFields, __ΩPluginHookObject, __ΩPluginHooks, __ΩPluginNonHookFields, __ΩTypesResult } from "./plugin.cjs";
|
|
7
4
|
import { CallHookOptions, HookListOrders, HooksList, HooksListItem, InferHookFunction, InferHookParameters, InferHookReturnType, InferHookThisType, NormalizedStringFilter, PluginFilter, TransformHookFilter, __ΩCallHookOptions, __ΩHookListOrders, __ΩHooksList, __ΩHooksListItem, __ΩInferHookFunction, __ΩInferHookParameters, __ΩInferHookReturnType, __ΩInferHookThisType, __ΩNormalizedStringFilter, __ΩPluginFilter, __ΩTransformHookFilter } from "./hooks.cjs";
|
|
5
|
+
import { WorkerProcess, __ΩWorkerProcess } from "./utils.cjs";
|
|
6
|
+
import { API, APIFunctions, BaseAPIFunctions, Engine, Execution, ExecutionWorkerParams, ExecutionWorkerProcess, SupportedCommands, __ΩAPI, __ΩAPIFunctions, __ΩBaseAPIFunctions, __ΩEngine, __ΩExecution, __ΩExecutionWorkerParams, __ΩExecutionWorkerProcess, __ΩSupportedCommands } from "./api.cjs";
|
|
7
|
+
import { ResolveOptions, StorageAdapter, StoragePort, StoragePreset, VirtualFile, VirtualFileData, VirtualFileExtension, VirtualFileMetadata, VirtualFileSystemInterface, WriteData, WriteOptions, __ΩResolveOptions, __ΩStorageAdapter, __ΩStoragePort, __ΩStoragePreset, __ΩVirtualFile, __ΩVirtualFileData, __ΩVirtualFileExtension, __ΩVirtualFileMetadata, __ΩVirtualFileSystemInterface, __ΩWriteData, __ΩWriteOptions } from "./fs.cjs";
|
|
8
8
|
import { CustomLogger, CustomLoggerMessage, LOG_CATEGORIES, LOG_LEVELS, LogCategories, LogCategory, LogFn, LogFnMeta, LogFnOptions, LogLevel, LogLevelResolvedConfig, LogLevelUserConfig, LogLevels, LogMessage, LogMeta, Logger, LoggerMessage, LoggerMeta, LoggerOptions, PowerlinesMessage, __ΩCustomLogger, __ΩCustomLoggerMessage, __ΩLogCategory, __ΩLogFn, __ΩLogFnMeta, __ΩLogFnOptions, __ΩLogLevel, __ΩLogLevelResolvedConfig, __ΩLogLevelUserConfig, __ΩLogMessage, __ΩLogMeta, __ΩLogger, __ΩLoggerMessage, __ΩLoggerMeta, __ΩLoggerOptions, __ΩPowerlinesMessage } from "./logging.cjs";
|
|
9
9
|
import { DeepkitOptions, Level, ParsedTypeScriptConfig, RawReflectionMode, ReflectionMode, TSCompilerOptions, TSConfig, __ΩDeepkitOptions, __ΩLevel, __ΩParsedTypeScriptConfig, __ΩRawReflectionMode, __ΩReflectionMode, __ΩTSCompilerOptions, __ΩTSConfig } from "./tsconfig.cjs";
|
|
10
10
|
import { BaseContext, BuildPluginContext, Context, EmitEntryOptions, EmitOptions, EngineContext, EnvironmentContext, EnvironmentContextPlugin, ExecutionContext, ExecutionState, ExecutionStateItem, FetchOptions, HookExecutionStateItem, InitContextOptions, MetaInfo, ParseOptions, PluginContext, ResolveResult, Resolver, SelectHookResult, SelectHookResultItem, SelectHooksOptions, SourceFile, TransformResult, UnimportContext, UnresolvedContext, WithUnpluginBuildContext, __ΩBaseContext, __ΩBuildPluginContext, __ΩContext, __ΩEmitEntryOptions, __ΩEmitOptions, __ΩEngineContext, __ΩEnvironmentContext, __ΩEnvironmentContextPlugin, __ΩExecutionContext, __ΩExecutionState, __ΩExecutionStateItem, __ΩFetchOptions, __ΩHookExecutionStateItem, __ΩInitContextOptions, __ΩMetaInfo, __ΩParseOptions, __ΩPluginContext, __ΩResolveResult, __ΩResolver, __ΩSelectHookResult, __ΩSelectHookResultItem, __ΩSelectHooksOptions, __ΩSourceFile, __ΩTransformResult, __ΩUnimportContext, __ΩUnresolvedContext, __ΩWithUnpluginBuildContext } from "./context.cjs";
|
|
11
|
-
import { AnyOutputUserConfig, AnyUserConfig, BuildInlineConfig, CleanInlineConfig, Config, CopyConfig,
|
|
11
|
+
import { AnyOutputUserConfig, AnyUserConfig, BuildInlineConfig, CleanInlineConfig, Config, CopyConfig, DeployInlineConfig, DocsInlineConfig, EngineOptions, EnvironmentConfig, EnvironmentResolvedConfig, ExecutionOptions, InferOverridableConfig, InitialPluginConfig, InlineConfig, LintInlineConfig, Mode, NewInlineConfig, Options, OutputConfig, ParsedUserConfig, PartialPlugin, PartialPluginFactory, PluginConfig, PluginConfigObject, PluginConfigTuple, PluginFactory, PowerlinesCommand, PrepareInlineConfig, ProjectType, ResolveConfig, ResolvedAssetGlob, ResolvedConfig, ResolvedCopyConfig, ResolvedEntryTypeDefinition, ResolvedEnvironmentConfig, ResolvedOutputConfig, ResolvedResolveConfig, TestInlineConfig, TypesInlineConfig, UserConfig, UserConfigFn, WorkspaceConfig, __ΩAnyOutputUserConfig, __ΩAnyUserConfig, __ΩBuildInlineConfig, __ΩCleanInlineConfig, __ΩConfig, __ΩCopyConfig, __ΩDeployInlineConfig, __ΩDocsInlineConfig, __ΩEngineOptions, __ΩEnvironmentConfig, __ΩEnvironmentResolvedConfig, __ΩExecutionOptions, __ΩInferOverridableConfig, __ΩInitialPluginConfig, __ΩInlineConfig, __ΩLintInlineConfig, __ΩMode, __ΩNewInlineConfig, __ΩOptions, __ΩOutputConfig, __ΩParsedUserConfig, __ΩPartialPlugin, __ΩPartialPluginFactory, __ΩPluginConfig, __ΩPluginConfigObject, __ΩPluginConfigTuple, __ΩPluginFactory, __ΩPowerlinesCommand, __ΩPrepareInlineConfig, __ΩProjectType, __ΩResolveConfig, __ΩResolvedAssetGlob, __ΩResolvedConfig, __ΩResolvedCopyConfig, __ΩResolvedEntryTypeDefinition, __ΩResolvedEnvironmentConfig, __ΩResolvedOutputConfig, __ΩResolvedResolveConfig, __ΩTestInlineConfig, __ΩTypesInlineConfig, __ΩUserConfig, __ΩUserConfigFn, __ΩWorkspaceConfig } from "./config.cjs";
|
package/dist/types/index.d.mts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { ResolveOptions, StorageAdapter, StoragePort, StoragePreset, VirtualFile, VirtualFileData, VirtualFileExtension, VirtualFileMetadata, VirtualFileSystemInterface, WriteData, WriteOptions, __ΩResolveOptions, __ΩStorageAdapter, __ΩStoragePort, __ΩStoragePreset, __ΩVirtualFile, __ΩVirtualFileData, __ΩVirtualFileExtension, __ΩVirtualFileMetadata, __ΩVirtualFileSystemInterface, __ΩWriteData, __ΩWriteOptions } from "./fs.mjs";
|
|
2
1
|
import { BaseCommandType, CommandType, Commands, __ΩBaseCommandType, __ΩCommandType, __ΩCommands } from "./commands.mjs";
|
|
3
|
-
import { WorkerProcess, __ΩWorkerProcess } from "./utils.mjs";
|
|
4
|
-
import { API, APIFunctions, BaseAPIFunctions, Engine, Execution, ExecutionWorkerParams, ExecutionWorkerProcess, SupportedCommands, __ΩAPI, __ΩAPIFunctions, __ΩBaseAPIFunctions, __ΩEngine, __ΩExecution, __ΩExecutionWorkerParams, __ΩExecutionWorkerProcess, __ΩSupportedCommands } from "./api.mjs";
|
|
5
2
|
import { BuilderVariant, InferUnpluginOptions, InferUnpluginVariant, UnpluginAsyncFactory, UnpluginBuilderVariant, UnpluginFactory, UnpluginHookFunctions, UnpluginInitialConfig, UnpluginOptions, __ΩBuilderVariant, __ΩInferUnpluginOptions, __ΩInferUnpluginVariant, __ΩUnpluginAsyncFactory, __ΩUnpluginBuilderVariant, __ΩUnpluginFactory, __ΩUnpluginHookFunctions, __ΩUnpluginInitialConfig, __ΩUnpluginOptions } from "./unplugin.mjs";
|
|
6
3
|
import { BasePlugin, HookFunctions, Hooks, Plugin, PluginHook, PluginHookFields, PluginHookObject, PluginHooks, PluginNonHookFields, TypesResult, __ΩBasePlugin, __ΩHookFunctions, __ΩHooks, __ΩPlugin, __ΩPluginHook, __ΩPluginHookFields, __ΩPluginHookObject, __ΩPluginHooks, __ΩPluginNonHookFields, __ΩTypesResult } from "./plugin.mjs";
|
|
7
4
|
import { CallHookOptions, HookListOrders, HooksList, HooksListItem, InferHookFunction, InferHookParameters, InferHookReturnType, InferHookThisType, NormalizedStringFilter, PluginFilter, TransformHookFilter, __ΩCallHookOptions, __ΩHookListOrders, __ΩHooksList, __ΩHooksListItem, __ΩInferHookFunction, __ΩInferHookParameters, __ΩInferHookReturnType, __ΩInferHookThisType, __ΩNormalizedStringFilter, __ΩPluginFilter, __ΩTransformHookFilter } from "./hooks.mjs";
|
|
5
|
+
import { WorkerProcess, __ΩWorkerProcess } from "./utils.mjs";
|
|
6
|
+
import { API, APIFunctions, BaseAPIFunctions, Engine, Execution, ExecutionWorkerParams, ExecutionWorkerProcess, SupportedCommands, __ΩAPI, __ΩAPIFunctions, __ΩBaseAPIFunctions, __ΩEngine, __ΩExecution, __ΩExecutionWorkerParams, __ΩExecutionWorkerProcess, __ΩSupportedCommands } from "./api.mjs";
|
|
7
|
+
import { ResolveOptions, StorageAdapter, StoragePort, StoragePreset, VirtualFile, VirtualFileData, VirtualFileExtension, VirtualFileMetadata, VirtualFileSystemInterface, WriteData, WriteOptions, __ΩResolveOptions, __ΩStorageAdapter, __ΩStoragePort, __ΩStoragePreset, __ΩVirtualFile, __ΩVirtualFileData, __ΩVirtualFileExtension, __ΩVirtualFileMetadata, __ΩVirtualFileSystemInterface, __ΩWriteData, __ΩWriteOptions } from "./fs.mjs";
|
|
8
8
|
import { CustomLogger, CustomLoggerMessage, LOG_CATEGORIES, LOG_LEVELS, LogCategories, LogCategory, LogFn, LogFnMeta, LogFnOptions, LogLevel, LogLevelResolvedConfig, LogLevelUserConfig, LogLevels, LogMessage, LogMeta, Logger, LoggerMessage, LoggerMeta, LoggerOptions, PowerlinesMessage, __ΩCustomLogger, __ΩCustomLoggerMessage, __ΩLogCategory, __ΩLogFn, __ΩLogFnMeta, __ΩLogFnOptions, __ΩLogLevel, __ΩLogLevelResolvedConfig, __ΩLogLevelUserConfig, __ΩLogMessage, __ΩLogMeta, __ΩLogger, __ΩLoggerMessage, __ΩLoggerMeta, __ΩLoggerOptions, __ΩPowerlinesMessage } from "./logging.mjs";
|
|
9
9
|
import { DeepkitOptions, Level, ParsedTypeScriptConfig, RawReflectionMode, ReflectionMode, TSCompilerOptions, TSConfig, __ΩDeepkitOptions, __ΩLevel, __ΩParsedTypeScriptConfig, __ΩRawReflectionMode, __ΩReflectionMode, __ΩTSCompilerOptions, __ΩTSConfig } from "./tsconfig.mjs";
|
|
10
10
|
import { BaseContext, BuildPluginContext, Context, EmitEntryOptions, EmitOptions, EngineContext, EnvironmentContext, EnvironmentContextPlugin, ExecutionContext, ExecutionState, ExecutionStateItem, FetchOptions, HookExecutionStateItem, InitContextOptions, MetaInfo, ParseOptions, PluginContext, ResolveResult, Resolver, SelectHookResult, SelectHookResultItem, SelectHooksOptions, SourceFile, TransformResult, UnimportContext, UnresolvedContext, WithUnpluginBuildContext, __ΩBaseContext, __ΩBuildPluginContext, __ΩContext, __ΩEmitEntryOptions, __ΩEmitOptions, __ΩEngineContext, __ΩEnvironmentContext, __ΩEnvironmentContextPlugin, __ΩExecutionContext, __ΩExecutionState, __ΩExecutionStateItem, __ΩFetchOptions, __ΩHookExecutionStateItem, __ΩInitContextOptions, __ΩMetaInfo, __ΩParseOptions, __ΩPluginContext, __ΩResolveResult, __ΩResolver, __ΩSelectHookResult, __ΩSelectHookResultItem, __ΩSelectHooksOptions, __ΩSourceFile, __ΩTransformResult, __ΩUnimportContext, __ΩUnresolvedContext, __ΩWithUnpluginBuildContext } from "./context.mjs";
|
|
11
|
-
import { AnyOutputUserConfig, AnyUserConfig, BuildInlineConfig, CleanInlineConfig, Config, CopyConfig,
|
|
11
|
+
import { AnyOutputUserConfig, AnyUserConfig, BuildInlineConfig, CleanInlineConfig, Config, CopyConfig, DeployInlineConfig, DocsInlineConfig, EngineOptions, EnvironmentConfig, EnvironmentResolvedConfig, ExecutionOptions, InferOverridableConfig, InitialPluginConfig, InlineConfig, LintInlineConfig, Mode, NewInlineConfig, Options, OutputConfig, ParsedUserConfig, PartialPlugin, PartialPluginFactory, PluginConfig, PluginConfigObject, PluginConfigTuple, PluginFactory, PowerlinesCommand, PrepareInlineConfig, ProjectType, ResolveConfig, ResolvedAssetGlob, ResolvedConfig, ResolvedCopyConfig, ResolvedEntryTypeDefinition, ResolvedEnvironmentConfig, ResolvedOutputConfig, ResolvedResolveConfig, TestInlineConfig, TypesInlineConfig, UserConfig, UserConfigFn, WorkspaceConfig, __ΩAnyOutputUserConfig, __ΩAnyUserConfig, __ΩBuildInlineConfig, __ΩCleanInlineConfig, __ΩConfig, __ΩCopyConfig, __ΩDeployInlineConfig, __ΩDocsInlineConfig, __ΩEngineOptions, __ΩEnvironmentConfig, __ΩEnvironmentResolvedConfig, __ΩExecutionOptions, __ΩInferOverridableConfig, __ΩInitialPluginConfig, __ΩInlineConfig, __ΩLintInlineConfig, __ΩMode, __ΩNewInlineConfig, __ΩOptions, __ΩOutputConfig, __ΩParsedUserConfig, __ΩPartialPlugin, __ΩPartialPluginFactory, __ΩPluginConfig, __ΩPluginConfigObject, __ΩPluginConfigTuple, __ΩPluginFactory, __ΩPowerlinesCommand, __ΩPrepareInlineConfig, __ΩProjectType, __ΩResolveConfig, __ΩResolvedAssetGlob, __ΩResolvedConfig, __ΩResolvedCopyConfig, __ΩResolvedEntryTypeDefinition, __ΩResolvedEnvironmentConfig, __ΩResolvedOutputConfig, __ΩResolvedResolveConfig, __ΩTestInlineConfig, __ΩTypesInlineConfig, __ΩUserConfig, __ΩUserConfigFn, __ΩWorkspaceConfig } from "./config.mjs";
|
package/dist/types/plugin.d.cts
CHANGED
|
@@ -2,7 +2,7 @@ import { PLUGIN_NON_HOOK_FIELDS } from "../constants/plugin.cjs";
|
|
|
2
2
|
import { BaseCommandType } from "./commands.cjs";
|
|
3
3
|
import { UnpluginBuilderVariant, UnpluginOptions as UnpluginOptions$1 } from "./unplugin.cjs";
|
|
4
4
|
import { BuildPluginContext, PluginContext, ResolveResult, UnresolvedContext } from "./context.cjs";
|
|
5
|
-
import { EnvironmentConfig,
|
|
5
|
+
import { EnvironmentConfig, PluginConfig, ResolvedConfig, ResolvedEnvironmentConfig } from "./config.cjs";
|
|
6
6
|
import { AnyFunction, MaybePromise } from "@stryke/types/base";
|
|
7
7
|
import { HookFilter, TransformResult } from "unplugin";
|
|
8
8
|
import { ArrayValues } from "@stryke/types/array";
|
|
@@ -60,7 +60,7 @@ interface Hooks<TContext extends PluginContext> {
|
|
|
60
60
|
* @param environment - The Vite-like environment object containing information about the current build environment.
|
|
61
61
|
* @returns A promise that resolves when the hook is complete.
|
|
62
62
|
*/
|
|
63
|
-
configEnvironment: (this: TContext, name: string, environment: EnvironmentConfig) => MaybePromise<Partial<
|
|
63
|
+
configEnvironment: (this: TContext, name: string, environment: EnvironmentConfig) => MaybePromise<Partial<ResolvedEnvironmentConfig> | undefined | null>;
|
|
64
64
|
/**
|
|
65
65
|
* A hook that is called when the plugin is resolved.
|
|
66
66
|
*
|
|
@@ -176,16 +176,13 @@ interface BasePlugin<TContext extends PluginContext> {
|
|
|
176
176
|
* @returns `true` if the two plugins are the same, `false` otherwise.
|
|
177
177
|
*/
|
|
178
178
|
dedupe?: false | ((other: Plugin<any>) => boolean);
|
|
179
|
-
/**
|
|
180
|
-
* A list of pre-requisite plugins that must be loaded before this plugin can be used.
|
|
181
|
-
*/
|
|
182
179
|
/**
|
|
183
180
|
* Define environments where this plugin should be active. By default, the plugin is active in all environments.
|
|
184
181
|
*
|
|
185
182
|
* @param environment - The environment to check.
|
|
186
183
|
* @returns `true` if the plugin should be active in the specified environment, `false` otherwise.
|
|
187
184
|
*/
|
|
188
|
-
applyToEnvironment?: (environment:
|
|
185
|
+
applyToEnvironment?: (environment: ResolvedEnvironmentConfig) => boolean | PluginConfig<any>;
|
|
189
186
|
/**
|
|
190
187
|
* A function that returns configuration options to be merged with the build context's options.
|
|
191
188
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plugin.d.cts","names":[],"sources":["../../src/types/plugin.ts"],"mappings":";;;;;;;;;;;UAsCiB,gBAAA,uBACO,WAAA,wBACA,UAAA;;AAFxB;;EAOE,KAAA;EANsB;;;EAWtB,MAAA,GAAS,IAAA,CAAK,UAAA,EAAY,OAAA;EAAjB;;;EAKT,OAAA,EAAS,aAAA;AAAA;AAAA,KAGC,UAAA,uBACY,WAAA,wBACA,UAAA,YACpB,aAAA,GAAgB,gBAAA,CAAiB,aAAA,EAAe,OAAA;;;;UAKnC,WAAA;EACf,UAAA;EACA,IAAA;AAAA;AAAA,UAGe,KAAA,kBAAuB,aAAA;EAhB7B;;;AAGX;;;;;;;;;;;EA4BE,MAAA,GACE,IAAA,EAAM,iBAAA,CAAkB,QAAA,gBACrB,YAAA,CAAa,aAAA,CAAY,QAAA,cAAsB,MAAA;EA7B9B;;;;;;;;;AAOxB;;;;EAqCE,iBAAA,GACE,IAAA,EAAM,QAAA,EACN,IAAA,UACA,WAAA,EAAa,iBAAA,KACV,YAAA,CAAa,OAAA,CAAQ,yBAAA;EApCX;;;;;;;;EA8Cf,cAAA,GAAiB,IAAA,EAAM,QAAA,KAAa,YAAA;EA7B/B;;;;;;;EAsCL,KAAA,GACE,IAAA,EAAM,QAAA,EACN,IAAA,aACG,YAAA,CAAa,WAAA;EAFV;;;;;;EAUR,UAAA,GACE,IAAA,EAAM,kBAAA,CAAmB,QAAA,cAAsB,QAAA,KAC5C,YAAA;EASsB;;;;;;EAD3B,QAAA,GACE,IAAA,EAAM,kBAAA,CAAmB,QAAA,cAAsB,QAAA,KAC5C,YAAA;EAca;;;;;;;;EAJlB,SAAA,GACE,IAAA,EAAM,kBAAA,CAAmB,QAAA,cAAsB,QAAA,EAC/C,IAAA,UACA,EAAA,aACG,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M,MAAA;EAtFY;;;;;;;;;;;;;;;;EAwGlB,OAAA;EA7EE;;;;;;;;;EAwFF,MAAA,aAAmB,KAAA,EAAO,MAAA;EA5EH;;;;;;EAoFvB,kBAAA,IACE,WAAA,EAAa,yBAAA,eACA,YAAA;EApFb;;;;;;;;;;;;;;EAoGF,MAAA,GACI,UAAA,EAEI,IAAA,EAAM,iBAAA,CAAkB,QAAA,gBACrB,YAAA,CAAa,aAAA,CAAY,QAAA,cAAsB,MAAA,mBAErD,aAAA,CAAY,QAAA,cAAsB,MAAA;AAAA;AAAA,KAG7B,MAAA,kBACO,aAAA,CAAc,cAAA,IAAkB,aAAA,CAAc,cAAA,KAC7D,OAAA,CAAQ,WAAA,CAAY,QAAA,KACtB,UAAA,CAAW,QAAA,IACX,IAAA,CAAK,iBAAA,CAAgB,QAAA,GAAW,sBAAA;AAAA,KAEtB,mBAAA,GAAsB,WAAA,QAAmB,sBAAA;AAAA,KAEzC,gBAAA,kBACO,aAAA,GAAgB,aAAA,kCAGjC,IAAA,SAAa,WAAA,QAAmB,sBAAA,YAE5B,IAAA,eAAmB,aAAA,CAAc,QAAA,IAC/B,aAAA,CAAc,QAAA,EAAU,IAAA,UAAc,WAAA,GACpC,IAAA,GACA,aAAA,CAAc,QAAA,EAAU,IAAA,iCAER,aAAA,CAAc,QAAA,EAAU,IAAA,QAAY,IAAA,IAAQ,CAAA,oBAClD,aAAA,CAAc,QAAA,EAAU,IAAA;AAAA"}
|
package/dist/types/plugin.d.mts
CHANGED
|
@@ -2,7 +2,7 @@ import { PLUGIN_NON_HOOK_FIELDS } from "../constants/plugin.mjs";
|
|
|
2
2
|
import { BaseCommandType } from "./commands.mjs";
|
|
3
3
|
import { UnpluginBuilderVariant, UnpluginOptions as UnpluginOptions$1 } from "./unplugin.mjs";
|
|
4
4
|
import { BuildPluginContext, PluginContext, ResolveResult, UnresolvedContext } from "./context.mjs";
|
|
5
|
-
import { EnvironmentConfig,
|
|
5
|
+
import { EnvironmentConfig, PluginConfig, ResolvedConfig, ResolvedEnvironmentConfig } from "./config.mjs";
|
|
6
6
|
import { HookFilter, TransformResult } from "unplugin";
|
|
7
7
|
import { AnyFunction, MaybePromise } from "@stryke/types/base";
|
|
8
8
|
import { ArrayValues } from "@stryke/types/array";
|
|
@@ -60,7 +60,7 @@ interface Hooks<TContext extends PluginContext> {
|
|
|
60
60
|
* @param environment - The Vite-like environment object containing information about the current build environment.
|
|
61
61
|
* @returns A promise that resolves when the hook is complete.
|
|
62
62
|
*/
|
|
63
|
-
configEnvironment: (this: TContext, name: string, environment: EnvironmentConfig) => MaybePromise<Partial<
|
|
63
|
+
configEnvironment: (this: TContext, name: string, environment: EnvironmentConfig) => MaybePromise<Partial<ResolvedEnvironmentConfig> | undefined | null>;
|
|
64
64
|
/**
|
|
65
65
|
* A hook that is called when the plugin is resolved.
|
|
66
66
|
*
|
|
@@ -176,16 +176,13 @@ interface BasePlugin<TContext extends PluginContext> {
|
|
|
176
176
|
* @returns `true` if the two plugins are the same, `false` otherwise.
|
|
177
177
|
*/
|
|
178
178
|
dedupe?: false | ((other: Plugin<any>) => boolean);
|
|
179
|
-
/**
|
|
180
|
-
* A list of pre-requisite plugins that must be loaded before this plugin can be used.
|
|
181
|
-
*/
|
|
182
179
|
/**
|
|
183
180
|
* Define environments where this plugin should be active. By default, the plugin is active in all environments.
|
|
184
181
|
*
|
|
185
182
|
* @param environment - The environment to check.
|
|
186
183
|
* @returns `true` if the plugin should be active in the specified environment, `false` otherwise.
|
|
187
184
|
*/
|
|
188
|
-
applyToEnvironment?: (environment:
|
|
185
|
+
applyToEnvironment?: (environment: ResolvedEnvironmentConfig) => boolean | PluginConfig<any>;
|
|
189
186
|
/**
|
|
190
187
|
* A function that returns configuration options to be merged with the build context's options.
|
|
191
188
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plugin.d.mts","names":[],"sources":["../../src/types/plugin.ts"],"mappings":";;;;;;;;;;;UAsCiB,gBAAA,uBACO,WAA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EAAM,iBAAA,CAAkB,QAAA,gBACrB,YAAA,CAAa,aAAA,CAAY,QAAA,cAAsB,MAAA,mBAErD,aAAA,CAAY,QAAA,cAAsB,MAAA;AAAA;AAAA,KAG7B,MAAA,kBACO,aAAA,CAAc,cAAA,IAAkB,aAAA,CAAc,cAAA,KAC7D,OAAA,CAAQ,WAAA,CAAY,QAAA,KACtB,UAAA,CAAW,QAAA,IACX,IAAA,CAAK,iBAAA,CAAgB,QAAA,GAAW,sBAAA;AAAA,KAEtB,mBAAA,GAAsB,WAAA,QAAmB,sBAAA;AAAA,KAEzC,gBAAA,kBACO,aAAA,GAAgB,aAAA,kCAGjC,IAAA,SAAa,WAAA,QAAmB,sBAAA,YAE5B,IAAA,eAAmB,aAAA,CAAc,QAAA,IAC/B,aAAA,CAAc,QAAA,EAAU,IAAA,UAAc,WAAA,GACpC,IAAA,GACA,aAAA,CAAc,QAAA,EAAU,IAAA,iCAER,aAAA,CAAc,QAAA,EAAU,IAAA,QAAY,IAAA,IAAQ,CAAA,oBAClD,aAAA,CAAc,QAAA,EAAU,IAAA;AAAA"}
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import { API } from "./api.cjs";
|
|
2
1
|
import { PluginHook } from "./plugin.cjs";
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
2
|
+
import { API } from "./api.cjs";
|
|
3
|
+
import { PluginContext, WithUnpluginBuildContext } from "./context.cjs";
|
|
4
|
+
import { InitialPluginConfig, UserConfig } from "./config.cjs";
|
|
5
|
+
import { DeepPartial, MaybePromise } from "@stryke/types/base";
|
|
6
6
|
import { HookFilter, UnpluginContextMeta, UnpluginOptions } from "unplugin";
|
|
7
7
|
|
|
8
8
|
//#region src/types/unplugin.d.ts
|
|
9
9
|
type UnpluginBuilderVariant = "rollup" | "webpack" | "rspack" | "vite" | "esbuild" | "farm" | "unloader" | "rolldown" | "bun";
|
|
10
10
|
type BuilderVariant = UnpluginBuilderVariant | "tsup" | "tsdown" | "unbuild";
|
|
11
11
|
type InferUnpluginVariant<TBuildVariant extends BuilderVariant> = TBuildVariant extends "tsup" ? "esbuild" : TBuildVariant extends "tsdown" ? "rolldown" : TBuildVariant extends "unbuild" ? "rollup" : TBuildVariant;
|
|
12
|
-
interface UnpluginOptions$1<TContext extends
|
|
12
|
+
interface UnpluginOptions$1<TContext extends PluginContext = PluginContext> extends UnpluginOptions {
|
|
13
13
|
/**
|
|
14
14
|
* An API object that can be used for inter-plugin communication.
|
|
15
15
|
*
|
|
@@ -17,17 +17,17 @@ interface UnpluginOptions$1<TContext extends Context = Context> extends Unplugin
|
|
|
17
17
|
*/
|
|
18
18
|
api: API<TContext["config"]>;
|
|
19
19
|
}
|
|
20
|
-
type InferUnpluginOptions<TContext extends
|
|
20
|
+
type InferUnpluginOptions<TContext extends PluginContext = PluginContext, TBuilderVariant extends BuilderVariant = BuilderVariant, TUnpluginVariant extends InferUnpluginVariant<TBuilderVariant> = InferUnpluginVariant<TBuilderVariant>> = { [TKey in keyof Required<UnpluginOptions$1<TContext>>[TUnpluginVariant]]?: Required<UnpluginOptions$1<TContext>>[TUnpluginVariant][TKey] extends infer THandler | {
|
|
21
21
|
handler: infer THandler;
|
|
22
22
|
} ? THandler extends ((this: infer TOriginalContext, ...args: infer TArgs) => infer TReturn) ? PluginHook<(this: TOriginalContext & TContext, ...args: TArgs) => MaybePromise<TReturn>, keyof HookFilter> : Required<UnpluginOptions$1<TContext>>[TUnpluginVariant][TKey] : Required<UnpluginOptions$1<TContext>>[TUnpluginVariant][TKey] };
|
|
23
|
-
type UnpluginInitialConfig =
|
|
23
|
+
type UnpluginInitialConfig = DeepPartial<UserConfig> & {
|
|
24
24
|
/**
|
|
25
25
|
* The meta information for the unplugin context
|
|
26
26
|
*/
|
|
27
27
|
unplugin: UnpluginContextMeta;
|
|
28
28
|
};
|
|
29
|
-
type UnpluginFactory<TContext extends
|
|
30
|
-
type UnpluginAsyncFactory<TContext extends
|
|
29
|
+
type UnpluginFactory<TContext extends PluginContext = PluginContext> = (options: InitialPluginConfig<TContext["config"]["userConfig"]>, meta: UnpluginContextMeta) => UnpluginOptions$1<TContext>;
|
|
30
|
+
type UnpluginAsyncFactory<TContext extends PluginContext = PluginContext> = (options: InitialPluginConfig<TContext["config"]["userConfig"]>, meta: UnpluginContextMeta) => Promise<UnpluginOptions$1<TContext>>;
|
|
31
31
|
type UnpluginHookFunctions<TContext extends PluginContext = PluginContext, TUnpluginBuilderVariant extends UnpluginBuilderVariant = UnpluginBuilderVariant, TField extends keyof Required<UnpluginOptions$1>[TUnpluginBuilderVariant] = keyof Required<UnpluginOptions$1>[TUnpluginBuilderVariant]> = Required<UnpluginOptions$1>[TUnpluginBuilderVariant][TField] extends infer THandler | {
|
|
32
32
|
handler: infer THandler;
|
|
33
33
|
} ? THandler extends ((this: infer THandlerOriginalContext, ...args: infer THandlerArgs) => infer THandlerReturn) ? (this: THandlerOriginalContext & WithUnpluginBuildContext<TContext>, ...args: THandlerArgs) => THandlerReturn : THandler extends {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"unplugin.d.cts","names":[],"sources":["../../src/types/unplugin.ts"],"mappings":";;;;;;;;
|
|
1
|
+
{"version":3,"file":"unplugin.d.cts","names":[],"sources":["../../src/types/unplugin.ts"],"mappings":";;;;;;;;KA6BY,sBAAA;AAAA,KAWA,cAAA,GACR,sBAAA;AAAA,KAKQ,oBAAA,uBAA2C,cAAA,IACrD,aAAA,8BAEI,aAAA,iCAEE,aAAA,gCAEE,aAAA;AAAA,UAEO,iBAAA,kBACE,aAAA,GAAgB,aAAA,UACzB,eAAA;;;;AAjBV;;EAuBE,GAAA,EAAK,GAAA,CAAI,QAAA;AAAA;AAAA,KAGC,oBAAA,kBACO,aAAA,GAAgB,aAAA,0BACT,cAAA,GAAiB,cAAA,2BAChB,oBAAA,CAAqB,eAAA,IAC5C,oBAAA,CAAqB,eAAA,sBAER,QAAA,CACb,iBAAA,CAAgB,QAAA,GAChB,gBAAA,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ACN,sBAAA;AAAA"}
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import { API } from "./api.mjs";
|
|
2
1
|
import { PluginHook } from "./plugin.mjs";
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
2
|
+
import { API } from "./api.mjs";
|
|
3
|
+
import { PluginContext, WithUnpluginBuildContext } from "./context.mjs";
|
|
4
|
+
import { InitialPluginConfig, UserConfig } from "./config.mjs";
|
|
5
5
|
import { HookFilter, UnpluginContextMeta, UnpluginOptions } from "unplugin";
|
|
6
|
-
import { MaybePromise } from "@stryke/types/base";
|
|
6
|
+
import { DeepPartial, MaybePromise } from "@stryke/types/base";
|
|
7
7
|
|
|
8
8
|
//#region src/types/unplugin.d.ts
|
|
9
9
|
type UnpluginBuilderVariant = "rollup" | "webpack" | "rspack" | "vite" | "esbuild" | "farm" | "unloader" | "rolldown" | "bun";
|
|
10
10
|
type BuilderVariant = UnpluginBuilderVariant | "tsup" | "tsdown" | "unbuild";
|
|
11
11
|
type InferUnpluginVariant<TBuildVariant extends BuilderVariant> = TBuildVariant extends "tsup" ? "esbuild" : TBuildVariant extends "tsdown" ? "rolldown" : TBuildVariant extends "unbuild" ? "rollup" : TBuildVariant;
|
|
12
|
-
interface UnpluginOptions$1<TContext extends
|
|
12
|
+
interface UnpluginOptions$1<TContext extends PluginContext = PluginContext> extends UnpluginOptions {
|
|
13
13
|
/**
|
|
14
14
|
* An API object that can be used for inter-plugin communication.
|
|
15
15
|
*
|
|
@@ -17,17 +17,17 @@ interface UnpluginOptions$1<TContext extends Context = Context> extends Unplugin
|
|
|
17
17
|
*/
|
|
18
18
|
api: API<TContext["config"]>;
|
|
19
19
|
}
|
|
20
|
-
type InferUnpluginOptions<TContext extends
|
|
20
|
+
type InferUnpluginOptions<TContext extends PluginContext = PluginContext, TBuilderVariant extends BuilderVariant = BuilderVariant, TUnpluginVariant extends InferUnpluginVariant<TBuilderVariant> = InferUnpluginVariant<TBuilderVariant>> = { [TKey in keyof Required<UnpluginOptions$1<TContext>>[TUnpluginVariant]]?: Required<UnpluginOptions$1<TContext>>[TUnpluginVariant][TKey] extends infer THandler | {
|
|
21
21
|
handler: infer THandler;
|
|
22
22
|
} ? THandler extends ((this: infer TOriginalContext, ...args: infer TArgs) => infer TReturn) ? PluginHook<(this: TOriginalContext & TContext, ...args: TArgs) => MaybePromise<TReturn>, keyof HookFilter> : Required<UnpluginOptions$1<TContext>>[TUnpluginVariant][TKey] : Required<UnpluginOptions$1<TContext>>[TUnpluginVariant][TKey] };
|
|
23
|
-
type UnpluginInitialConfig =
|
|
23
|
+
type UnpluginInitialConfig = DeepPartial<UserConfig> & {
|
|
24
24
|
/**
|
|
25
25
|
* The meta information for the unplugin context
|
|
26
26
|
*/
|
|
27
27
|
unplugin: UnpluginContextMeta;
|
|
28
28
|
};
|
|
29
|
-
type UnpluginFactory<TContext extends
|
|
30
|
-
type UnpluginAsyncFactory<TContext extends
|
|
29
|
+
type UnpluginFactory<TContext extends PluginContext = PluginContext> = (options: InitialPluginConfig<TContext["config"]["userConfig"]>, meta: UnpluginContextMeta) => UnpluginOptions$1<TContext>;
|
|
30
|
+
type UnpluginAsyncFactory<TContext extends PluginContext = PluginContext> = (options: InitialPluginConfig<TContext["config"]["userConfig"]>, meta: UnpluginContextMeta) => Promise<UnpluginOptions$1<TContext>>;
|
|
31
31
|
type UnpluginHookFunctions<TContext extends PluginContext = PluginContext, TUnpluginBuilderVariant extends UnpluginBuilderVariant = UnpluginBuilderVariant, TField extends keyof Required<UnpluginOptions$1>[TUnpluginBuilderVariant] = keyof Required<UnpluginOptions$1>[TUnpluginBuilderVariant]> = Required<UnpluginOptions$1>[TUnpluginBuilderVariant][TField] extends infer THandler | {
|
|
32
32
|
handler: infer THandler;
|
|
33
33
|
} ? THandler extends ((this: infer THandlerOriginalContext, ...args: infer THandlerArgs) => infer THandlerReturn) ? (this: THandlerOriginalContext & WithUnpluginBuildContext<TContext>, ...args: THandlerArgs) => THandlerReturn : THandler extends {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"unplugin.d.mts","names":[],"sources":["../../src/types/unplugin.ts"],"mappings":";;;;;;;;
|
|
1
|
+
{"version":3,"file":"unplugin.d.mts","names":[],"sources":["../../src/types/unplugin.ts"],"mappings":";;;;;;;;KA6BY,sBAAA;AAAA,KAWA,cAAA,GACR,sBAAA;AAAA,KAKQ,oBAAA,uBAA2C,cAAA,IACrD,aAAA,8BAEI,aAAA,iCAEE,aAAA,gCAEE,aAAA;AAAA,UAEO,iBAAA,kBACE,aAAA,GAAgB,aAAA,UACzB,eAAA;;;;AAjBV;;EAuBE,GAAA,EAAK,GAAA,CAAI,QAAA;AAAA;AAAA,KAGC,oBAAA,kBACO,aAAA,GAAgB,aAAA,0BACT,cAAA,GAAiB,cAAA,2BAChB,oBAAA,CAAqB,eAAA,IAC5C,oBAAA,CAAqB,eAAA,sBAER,QAAA,CACb,iBAAA,CAAgB,QAAA,GAChB,gBAAA,KAAqB,QAAA,CACrB,iBAAA,CAAgB,QAAA,GAChB,gBAAA,EAAkB,IAAA;EAGd,OAAA;AAAA,IAEF,QAAA,WACE,IAAA,6BACG,IAAA,mCAEH,UAAA,EAEI,IAAA,EAAM,gBAAA,GAAmB,QAAA,KACtB,IAAA,EAAM,KAAA,KACN,YAAA,CAAa,OAAA,SACZ,UAAA,IAER,QAAA,CAAS,iBAAA,CAAgB,QAAA,GAAW,gBAAA,EAAkB,IAAA,IACxD,QAAA,CAAS,iBAAA,CAAgB,QAAA,GAAW,gBAAA,EAAkB,IAAA;AAAA,KAGhD,qBAAA,GAAwB,WAAA,CAAY,UAAA;EA/C1C;;;EAmDJ,QAAA,EAAU,mBAAA;AAAA;AAAA,KAGA,eAAA,kBAAiC,aAAA,GAAgB,aAAA,KAC3D,OAAA,EAAS,mBAAA,CAAoB,QAAA,2BAC7B,IAAA,EAAM,mBAAA,KACH,iBAAA,CAAgB,QAAA;AAAA,KAET,oBAAA,kBACO,aAAA,GAAgB,aAAA,KAEjC,O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