@powerlines/core 0.45.3 → 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
package/dist/types/config.d.mts
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { StoragePort, StoragePreset } from "./fs.mjs";
|
|
2
1
|
import { Plugin } from "./plugin.mjs";
|
|
2
|
+
import { StoragePort, StoragePreset } from "./fs.mjs";
|
|
3
3
|
import { CustomLogger, LogLevelResolvedConfig, LogLevelUserConfig } from "./logging.mjs";
|
|
4
4
|
import { TSConfig } from "./tsconfig.mjs";
|
|
5
5
|
import { PluginContext } from "./context.mjs";
|
|
6
6
|
import { ConfigLayer, ResolvedConfig } from "c12";
|
|
7
|
+
import { DeepPartial, MaybePromise, NonUndefined, RequiredKeys } from "@stryke/types/base";
|
|
7
8
|
import { Format } from "@storm-software/build-tools/types";
|
|
8
9
|
import { StormWorkspaceConfig } from "@storm-software/config/types";
|
|
9
|
-
import { DeepPartial, MaybePromise, NonUndefined, RequiredKeys } from "@stryke/types/base";
|
|
10
10
|
import { TypeDefinition, TypeDefinitionParameter } from "@stryke/types/configuration";
|
|
11
11
|
import { AssetGlob } from "@stryke/types/file";
|
|
12
12
|
import { CompatibilityDateSpec, CompatibilityDates } from "compatx";
|
|
@@ -233,7 +233,7 @@ interface OutputConfig {
|
|
|
233
233
|
*/
|
|
234
234
|
storage?: StoragePort | StoragePreset;
|
|
235
235
|
}
|
|
236
|
-
interface
|
|
236
|
+
interface Options {
|
|
237
237
|
/**
|
|
238
238
|
* The name of the project
|
|
239
239
|
*/
|
|
@@ -242,13 +242,6 @@ interface EngineInputOptions {
|
|
|
242
242
|
* The root directory of the project
|
|
243
243
|
*/
|
|
244
244
|
root?: string;
|
|
245
|
-
/**
|
|
246
|
-
* The current working directory the Powerlines processes should operate in
|
|
247
|
-
*
|
|
248
|
-
* @remarks
|
|
249
|
-
* If not provided, the {@link WorkspaceConfig.workspaceRoot | workspace root} will be used as the current working directory. If the workspace root cannot be determined, the process's current working directory will be used.
|
|
250
|
-
*/
|
|
251
|
-
cwd?: string;
|
|
252
245
|
/**
|
|
253
246
|
* Explicitly set a mode to run in. This mode will be used at various points throughout the Powerlines processes, such as when compiling the source code.
|
|
254
247
|
*
|
|
@@ -272,6 +265,15 @@ interface EngineInputOptions {
|
|
|
272
265
|
* The organization or author of the project
|
|
273
266
|
*/
|
|
274
267
|
organization?: string;
|
|
268
|
+
}
|
|
269
|
+
interface EngineOptions extends Options {
|
|
270
|
+
/**
|
|
271
|
+
* The current working directory the Powerlines processes should operate in
|
|
272
|
+
*
|
|
273
|
+
* @remarks
|
|
274
|
+
* If not provided, the {@link WorkspaceConfig.workspaceRoot | workspace root} will be used as the current working directory. If the workspace root cannot be determined, the process's current working directory will be used.
|
|
275
|
+
*/
|
|
276
|
+
cwd?: string;
|
|
275
277
|
/**
|
|
276
278
|
* A path to a custom configuration file to be used instead of the default `powerlines.json`, `powerlines.config.js`, or `powerlines.config.ts` files.
|
|
277
279
|
*
|
|
@@ -280,7 +282,6 @@ interface EngineInputOptions {
|
|
|
280
282
|
*/
|
|
281
283
|
configFile?: string;
|
|
282
284
|
}
|
|
283
|
-
type EngineOptions = RequiredKeys<EngineInputOptions, "root" | "framework">;
|
|
284
285
|
interface ExecutionOptions extends RequiredKeys<EngineOptions, "cwd"> {
|
|
285
286
|
/**
|
|
286
287
|
* A unique identifier for the current execution instance, which can be used for logging and other purposes to distinguish between different executions in the same process.
|
|
@@ -300,6 +301,17 @@ interface Config {
|
|
|
300
301
|
* Configuration for the output files generated by processing the source code
|
|
301
302
|
*/
|
|
302
303
|
output?: OutputConfig;
|
|
304
|
+
/**
|
|
305
|
+
* The date to use for compatibility checks
|
|
306
|
+
*
|
|
307
|
+
* @remarks
|
|
308
|
+
* This date can be used by plugins and build processes to determine compatibility with certain features or APIs. It is recommended to set this date to the date when the project was last known to be compatible with the desired features or APIs. If no value is provided, the latest compatibility date will be used.
|
|
309
|
+
*
|
|
310
|
+
* @see https://developers.cloudflare.com/pages/platform/compatibility-dates/
|
|
311
|
+
* @see https://docs.netlify.com/configure-builds/get-started/#set-a-compatibility-date
|
|
312
|
+
* @see https://github.com/unjs/compatx
|
|
313
|
+
*/
|
|
314
|
+
compatibilityDate?: CompatibilityDateSpec;
|
|
303
315
|
/**
|
|
304
316
|
* Configuration for module resolution during processing of the source code
|
|
305
317
|
*/
|
|
@@ -378,6 +390,13 @@ interface EnvironmentConfig extends Config {
|
|
|
378
390
|
* A flag indicating whether the build is for a Server-Side Rendering environment.
|
|
379
391
|
*/
|
|
380
392
|
ssr?: boolean;
|
|
393
|
+
/**
|
|
394
|
+
* The runtime environment for the build, which can be used by plugins to determine how to process the source code and generate runtime artifacts.
|
|
395
|
+
*
|
|
396
|
+
* @remarks
|
|
397
|
+
* This option can be used to specify the target runtime environment for the build, such as "nodejs", "browser", "workerd", or "edge". Plugins can use this information to determine how to process the source code and generate runtime artifacts that are compatible with the specified environment. If no value is provided, plugins will need to determine the runtime environment based on other factors, such as the presence of certain dependencies or configuration options.
|
|
398
|
+
*/
|
|
399
|
+
runtime?: "nodejs" | "browser" | "workerd" | "edge";
|
|
381
400
|
/**
|
|
382
401
|
* Define if this environment is used for Server-Side Rendering
|
|
383
402
|
*
|
|
@@ -385,7 +404,7 @@ interface EnvironmentConfig extends Config {
|
|
|
385
404
|
*/
|
|
386
405
|
consumer?: "client" | "server";
|
|
387
406
|
}
|
|
388
|
-
interface UserConfig extends
|
|
407
|
+
interface UserConfig extends Options, Config {
|
|
389
408
|
/**
|
|
390
409
|
* The name of the project
|
|
391
410
|
*/
|
|
@@ -411,17 +430,6 @@ interface UserConfig extends Config, ExecutionOptions {
|
|
|
411
430
|
* If this option is not provided, the build process will try to use the \`author\` value from the \`package.json\` file. If the \`author\` value cannot be determined, the {@link name | name configuration} will be used.
|
|
412
431
|
*/
|
|
413
432
|
organization?: string;
|
|
414
|
-
/**
|
|
415
|
-
* The date to use for compatibility checks
|
|
416
|
-
*
|
|
417
|
-
* @remarks
|
|
418
|
-
* This date can be used by plugins and build processes to determine compatibility with certain features or APIs. It is recommended to set this date to the date when the project was last known to be compatible with the desired features or APIs. If no value is provided, the latest compatibility date will be used.
|
|
419
|
-
*
|
|
420
|
-
* @see https://developers.cloudflare.com/pages/platform/compatibility-dates/
|
|
421
|
-
* @see https://docs.netlify.com/configure-builds/get-started/#set-a-compatibility-date
|
|
422
|
-
* @see https://github.com/unjs/compatx
|
|
423
|
-
*/
|
|
424
|
-
compatibilityDate?: CompatibilityDateSpec;
|
|
425
433
|
/**
|
|
426
434
|
* The log level label indicating the severity of the log message, or a more detailed log level configuration object that allows for specifying different log levels for different categories of logs.
|
|
427
435
|
*
|
|
@@ -481,14 +489,7 @@ interface UserConfig extends Config, ExecutionOptions {
|
|
|
481
489
|
singleBuild?: boolean;
|
|
482
490
|
}
|
|
483
491
|
type PowerlinesCommand = "new" | "types" | "prepare" | "build" | "lint" | "test" | "docs" | "deploy" | "clean";
|
|
484
|
-
|
|
485
|
-
* The configuration provided when initializing the Powerlines API.
|
|
486
|
-
*
|
|
487
|
-
* @remarks
|
|
488
|
-
* This configuration is used during the initialization of the Powerlines API.
|
|
489
|
-
*/
|
|
490
|
-
type InitialConfig<TUserConfig extends UserConfig = UserConfig> = DeepPartial<TUserConfig>;
|
|
491
|
-
type InitialPluginConfig<TUserConfig extends UserConfig = UserConfig> = InitialConfig<TUserConfig> & EngineOptions;
|
|
492
|
+
type InitialPluginConfig<TUserConfig extends UserConfig = UserConfig> = DeepPartial<TUserConfig> & EngineOptions;
|
|
492
493
|
/**
|
|
493
494
|
* The configuration provided while executing Powerlines commands.
|
|
494
495
|
*/
|
|
@@ -560,7 +561,7 @@ type DeployInlineConfig<TUserConfig extends UserConfig = UserConfig> = InlineCon
|
|
|
560
561
|
*/
|
|
561
562
|
command: "deploy";
|
|
562
563
|
};
|
|
563
|
-
type UserConfigFn<TUserConfig extends UserConfig = UserConfig> = (params:
|
|
564
|
+
type UserConfigFn<TUserConfig extends UserConfig = UserConfig> = (params: Options) => MaybePromise<TUserConfig>;
|
|
564
565
|
type AnyOutputUserConfig = Partial<Omit<OutputConfig, "copy">> & {
|
|
565
566
|
/**
|
|
566
567
|
* The output configuration options to use for the build process
|
|
@@ -602,13 +603,13 @@ interface ResolvedEntryTypeDefinition extends TypeDefinition {
|
|
|
602
603
|
*/
|
|
603
604
|
output?: string;
|
|
604
605
|
}
|
|
605
|
-
type
|
|
606
|
+
type ResolvedEnvironmentConfig = RequiredKeys<Omit<EnvironmentConfig, "preview">, "consumer" | "ssr"> & {
|
|
606
607
|
/**
|
|
607
|
-
* A
|
|
608
|
+
* A string identifier for the environment used by the system and plugins to determine which environment-specific configuration to use during the build process.
|
|
608
609
|
*/
|
|
609
|
-
|
|
610
|
+
id: string;
|
|
610
611
|
/**
|
|
611
|
-
* The name of the environment
|
|
612
|
+
* The name of the environment provided by the user in the {@link UserConfig.environments | environments} configuration.
|
|
612
613
|
*/
|
|
613
614
|
name: string;
|
|
614
615
|
/**
|
|
@@ -619,7 +620,7 @@ type EnvironmentResolvedConfig = Omit<EnvironmentConfig, "consumer" | "ssr" | "p
|
|
|
619
620
|
/**
|
|
620
621
|
* The configuration options for resolving modules in a Powerlines project.
|
|
621
622
|
*/
|
|
622
|
-
type
|
|
623
|
+
type ResolvedResolveConfig = Required<Omit<ResolveConfig, "external" | "noExternal">> & {
|
|
623
624
|
/**
|
|
624
625
|
* A list of modules that should not be bundled, even if they are external dependencies.
|
|
625
626
|
*
|
|
@@ -633,58 +634,72 @@ type ResolveResolvedConfig = Required<Omit<ResolveConfig, "external" | "noExtern
|
|
|
633
634
|
noExternal?: string[];
|
|
634
635
|
};
|
|
635
636
|
type ResolvedAssetGlob = AssetGlob & Required<Pick<AssetGlob, "input">>;
|
|
636
|
-
type
|
|
637
|
+
type ResolvedCopyConfig = Required<Omit<CopyConfig, "assets">> & {
|
|
637
638
|
assets: ResolvedAssetGlob[];
|
|
638
639
|
};
|
|
639
|
-
type
|
|
640
|
-
copy:
|
|
640
|
+
type ResolvedOutputConfig = Required<Omit<OutputConfig, "copy" | "storage">> & Pick<OutputConfig, "storage"> & {
|
|
641
|
+
copy: ResolvedCopyConfig | false;
|
|
641
642
|
};
|
|
642
643
|
/**
|
|
643
|
-
* The resolved options for
|
|
644
|
+
* The base resolved configuration options for a Powerlines project, after being processed and normalized by the configuration loading process.
|
|
644
645
|
*/
|
|
645
|
-
type ResolvedConfig$1<TUserConfig extends UserConfig = UserConfig> = Omit<TUserConfig, "root" | "cwd" | "name" | "title" | "organization" | "compatibilityDate" | "plugins" | "mode" | "environments" | "tsconfig" | "platform" | "projectType" | "input" | "output" | "resolve" | "logLevel" | "framework"> & Required<Pick<TUserConfig, "root" | "
|
|
646
|
+
type ResolvedConfig$1<TUserConfig extends UserConfig = UserConfig> = Omit<TUserConfig, "root" | "cwd" | "name" | "title" | "organization" | "compatibilityDate" | "plugins" | "mode" | "environments" | "tsconfig" | "platform" | "projectType" | "input" | "output" | "resolve" | "logLevel" | "framework"> & Required<Pick<TUserConfig, "root" | "name" | "title" | "organization" | "compatibilityDate" | "plugins" | "mode" | "environments" | "input" | "tsconfig" | "platform" | "projectType" | "framework">> & {
|
|
646
647
|
/**
|
|
647
|
-
* The
|
|
648
|
+
* The configuration provided when initializing the Powerlines API.
|
|
649
|
+
*
|
|
650
|
+
* @remarks
|
|
651
|
+
* This configuration is used during the initialization of the Powerlines API.
|
|
648
652
|
*/
|
|
649
|
-
|
|
653
|
+
readonly initialConfig: DeepPartial<TUserConfig>;
|
|
650
654
|
/**
|
|
651
|
-
*
|
|
655
|
+
* The configuration options read from a configuration file on disk, which may be used to resolve the final configuration for the context. This typically includes the user configuration options defined in the `powerlines.config.ts` file, as well as any inline configuration options provided during execution.
|
|
652
656
|
*/
|
|
653
|
-
|
|
657
|
+
readonly userConfig: TUserConfig;
|
|
654
658
|
/**
|
|
655
|
-
* The
|
|
659
|
+
* The configuration options that were provided by Powerlines plugins, which may have been merged with the user configuration and modified by the configuration loading process.
|
|
660
|
+
*/
|
|
661
|
+
readonly pluginConfig: DeepPartial<TUserConfig>;
|
|
662
|
+
/**
|
|
663
|
+
* The configuration options provided by plugins added by the user (and other plugins)
|
|
664
|
+
*/
|
|
665
|
+
readonly inlineConfig: InlineConfig<TUserConfig>;
|
|
666
|
+
/**
|
|
667
|
+
* The current working directory the Powerlines processes should operate in
|
|
656
668
|
*
|
|
657
669
|
* @remarks
|
|
658
|
-
*
|
|
659
|
-
*
|
|
660
|
-
* @see https://developers.cloudflare.com/pages/platform/compatibility-dates/
|
|
661
|
-
* @see https://docs.netlify.com/configure-builds/get-started/#set-a-compatibility-date
|
|
662
|
-
* @see https://github.com/unjs/compatx
|
|
670
|
+
* If not provided, the {@link WorkspaceConfig.workspaceRoot | workspace root} will be used as the current working directory. If the workspace root cannot be determined, the process's current working directory will be used.
|
|
663
671
|
*/
|
|
664
|
-
|
|
672
|
+
readonly cwd: string;
|
|
665
673
|
/**
|
|
666
|
-
*
|
|
674
|
+
* A path to a custom configuration file to be used instead of the default `powerlines.json`, `powerlines.config.js`, or `powerlines.config.ts` files.
|
|
667
675
|
*
|
|
668
676
|
* @remarks
|
|
669
|
-
* This
|
|
677
|
+
* This option is useful for running Powerlines commands with different configuration files, such as in CI/CD environments or when testing different configurations.
|
|
670
678
|
*/
|
|
671
|
-
|
|
679
|
+
readonly configFile: string;
|
|
672
680
|
/**
|
|
673
|
-
* The configuration options
|
|
681
|
+
* The output configuration options to use for the build process
|
|
674
682
|
*/
|
|
675
|
-
|
|
683
|
+
output: ResolvedOutputConfig;
|
|
676
684
|
/**
|
|
677
|
-
*
|
|
685
|
+
* Configuration for module resolution during processing of the source code
|
|
678
686
|
*/
|
|
679
|
-
|
|
687
|
+
resolve: ResolvedResolveConfig;
|
|
680
688
|
/**
|
|
681
|
-
* The
|
|
689
|
+
* The date to use for compatibility checks
|
|
690
|
+
*
|
|
691
|
+
* @remarks
|
|
692
|
+
* This date can be used by plugins and build processes to determine compatibility with certain features or APIs. It is recommended to set this date to the date when the project was last known to be compatible with the desired features or APIs.
|
|
693
|
+
*
|
|
694
|
+
* @see https://developers.cloudflare.com/pages/platform/compatibility-dates/
|
|
695
|
+
* @see https://docs.netlify.com/configure-builds/get-started/#set-a-compatibility-date
|
|
696
|
+
* @see https://github.com/unjs/compatx
|
|
682
697
|
*/
|
|
683
|
-
|
|
698
|
+
compatibilityDate: CompatibilityDates;
|
|
684
699
|
/**
|
|
685
700
|
* A string identifier for the Powerlines command being executed.
|
|
686
701
|
*/
|
|
687
|
-
command: NonUndefined<InlineConfig<TUserConfig>["command"]>;
|
|
702
|
+
readonly command: NonUndefined<InlineConfig<TUserConfig>["command"]>;
|
|
688
703
|
/**
|
|
689
704
|
* The log level label indicating the severity of the log message, or a more detailed log level configuration object that allows for specifying different log levels for different categories of logs.
|
|
690
705
|
*
|
|
@@ -693,6 +708,23 @@ type ResolvedConfig$1<TUserConfig extends UserConfig = UserConfig> = Omit<TUserC
|
|
|
693
708
|
*/
|
|
694
709
|
logLevel: LogLevelResolvedConfig;
|
|
695
710
|
};
|
|
711
|
+
type InferOverridableConfig<TResolvedConfig extends ResolvedConfig$1 = ResolvedConfig$1> = DeepPartial<Omit<TResolvedConfig, "initialConfig" | "userConfig" | "pluginConfig" | "inlineConfig" | "cwd" | "configFile" | "command">>;
|
|
712
|
+
/**
|
|
713
|
+
* The resolved configuration options for a Powerlines environment, after being processed and normalized by the configuration loading process.
|
|
714
|
+
*/
|
|
715
|
+
type EnvironmentResolvedConfig<TResolvedConfig extends ResolvedConfig$1 = ResolvedConfig$1> = TResolvedConfig & {
|
|
716
|
+
/**
|
|
717
|
+
* The configuration provided when initializing the Powerlines API.
|
|
718
|
+
*
|
|
719
|
+
* @remarks
|
|
720
|
+
* This configuration is used during the initialization of the Powerlines API.
|
|
721
|
+
*/
|
|
722
|
+
readonly environmentConfig: EnvironmentConfig;
|
|
723
|
+
/**
|
|
724
|
+
* The resolved configuration options for the environment, which may include additional properties or modifications made during the configuration loading process.
|
|
725
|
+
*/
|
|
726
|
+
environment: ResolvedEnvironmentConfig;
|
|
727
|
+
};
|
|
696
728
|
declare type __ΩWorkspaceConfig = any[];
|
|
697
729
|
declare type __ΩPluginFactory = any[];
|
|
698
730
|
declare type __ΩPluginConfigTuple = any[];
|
|
@@ -705,14 +737,13 @@ declare type __ΩMode = any[];
|
|
|
705
737
|
declare type __ΩResolveConfig = any[];
|
|
706
738
|
declare type __ΩCopyConfig = any[];
|
|
707
739
|
declare type __ΩOutputConfig = any[];
|
|
708
|
-
declare type __Ω
|
|
740
|
+
declare type __ΩOptions = any[];
|
|
709
741
|
declare type __ΩEngineOptions = any[];
|
|
710
742
|
declare type __ΩExecutionOptions = any[];
|
|
711
743
|
declare type __ΩConfig = any[];
|
|
712
744
|
declare type __ΩEnvironmentConfig = any[];
|
|
713
745
|
declare type __ΩUserConfig = any[];
|
|
714
746
|
declare type __ΩPowerlinesCommand = any[];
|
|
715
|
-
declare type __ΩInitialConfig = any[];
|
|
716
747
|
declare type __ΩInitialPluginConfig = any[];
|
|
717
748
|
declare type __ΩInlineConfig = any[];
|
|
718
749
|
declare type __ΩNewInlineConfig = any[];
|
|
@@ -729,12 +760,14 @@ declare type __ΩAnyOutputUserConfig = any[];
|
|
|
729
760
|
declare type __ΩAnyUserConfig = any[];
|
|
730
761
|
declare type __ΩParsedUserConfig = any[];
|
|
731
762
|
declare type __ΩResolvedEntryTypeDefinition = any[];
|
|
732
|
-
declare type __Ω
|
|
733
|
-
declare type __Ω
|
|
763
|
+
declare type __ΩResolvedEnvironmentConfig = any[];
|
|
764
|
+
declare type __ΩResolvedResolveConfig = any[];
|
|
734
765
|
declare type __ΩResolvedAssetGlob = any[];
|
|
735
|
-
declare type __Ω
|
|
736
|
-
declare type __Ω
|
|
766
|
+
declare type __ΩResolvedCopyConfig = any[];
|
|
767
|
+
declare type __ΩResolvedOutputConfig = any[];
|
|
737
768
|
declare type __ΩResolvedConfig = any[];
|
|
769
|
+
declare type __ΩInferOverridableConfig = any[];
|
|
770
|
+
declare type __ΩEnvironmentResolvedConfig = any[];
|
|
738
771
|
//#endregion
|
|
739
|
-
export { AnyOutputUserConfig, AnyUserConfig, BuildInlineConfig, CleanInlineConfig, Config, CopyConfig,
|
|
772
|
+
export { 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$1 as 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 };
|
|
740
773
|
//# sourceMappingURL=config.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.d.mts","names":[],"sources":["../../src/types/config.ts"],"mappings":";;;;;;;;;;;;;;;;;AA+CA;KAAY,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;;;;KAKzD,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;AA1BN;;;AAAA,KAgCY,YAAA,kBAA8B,aAAA,GAAgB,aAAA,aAEtD,aAAA,CAAc,QAAA,UACd,MAAA,CAAO,QAAA,IACP,iBAAA,CAAkB,QAAA,IAClB,kBAAA,CAAmB,QAAA,IACnB,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AAc,YAAA,CAAa,WAAA;EA7IpC;;;;;;EAAA,SAqJS,GAAA;EAlJe;;;;;;EAAA,SA0Jf,UAAA;EAlJ8B;;;EAuJvC,MAAA,EAAQ,oBAAA;EAvJgB;;;EA4JxB,OAAA,EAAS,qBAAA;EAnKX;;;;;;;;;AAUF;EAqKI,iBAAA,EAAmB,kBAAA;;;;WAKV,OAAA,EAAS,YAAA,CAAa,YAAA,CAAa,WAAA;EAtKtC;;;;AAQV;;EAsKI,QAAA,EAAU,sBAAA;AAAA;AAAA,KAGF,sBAAA,yBACc,gBAAA,GAAiB,gBAAA,IACvC,WAAA,CACF,IAAA,CACE,eAAA;;;;KAcQ,yBAAA,yBACc,gBAAA,GAAiB,gBAAA,IACvC,eAAA;EA7LoC;;;;;;EAAA,SAoM7B,iBAAA,EAAmB,iBAAA;EAnLI;;AAMlC;EAkLE,WAAA,EAAa,yBAAA;AAAA;AAAA"}
|
package/dist/types/context.d.cts
CHANGED
|
@@ -1,9 +1,11 @@
|
|
|
1
|
-
import { ResolveOptions, VirtualFile, VirtualFileSystemInterface, WriteOptions } from "./fs.cjs";
|
|
2
1
|
import { Plugin } from "./plugin.cjs";
|
|
3
2
|
import { HooksList, HooksListItem } from "./hooks.cjs";
|
|
3
|
+
import { API } from "./api.cjs";
|
|
4
|
+
import { ResolveOptions, VirtualFile, VirtualFileSystemInterface, WriteOptions } from "./fs.cjs";
|
|
4
5
|
import { LogFn, LogLevelResolvedConfig, LogMessage, Logger, LoggerOptions } from "./logging.cjs";
|
|
5
6
|
import { ParsedTypeScriptConfig } from "./tsconfig.cjs";
|
|
6
|
-
import { EngineOptions, EnvironmentResolvedConfig, ExecutionOptions,
|
|
7
|
+
import { EngineOptions, EnvironmentResolvedConfig, ExecutionOptions, ParsedUserConfig, ResolvedConfig, ResolvedEntryTypeDefinition, UserConfig } from "./config.cjs";
|
|
8
|
+
import { DeepPartial, RequiredKeys } from "@stryke/types/base";
|
|
7
9
|
import { Jiti } from "jiti";
|
|
8
10
|
import { EnvPaths } from "@stryke/env/get-env-paths";
|
|
9
11
|
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;
|