@powerlines/plugin-nitro 0.1.17 → 0.1.18

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.
@@ -0,0 +1,29 @@
1
+ //#region rolldown:runtime
2
+ var __create = Object.create;
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __getProtoOf = Object.getPrototypeOf;
7
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
8
+ var __copyProps = (to, from, except, desc) => {
9
+ if (from && typeof from === "object" || typeof from === "function") {
10
+ for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
11
+ key = keys[i];
12
+ if (!__hasOwnProp.call(to, key) && key !== except) {
13
+ __defProp(to, key, {
14
+ get: ((k) => from[k]).bind(null, key),
15
+ enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
16
+ });
17
+ }
18
+ }
19
+ }
20
+ return to;
21
+ };
22
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
23
+ value: mod,
24
+ enumerable: true
25
+ }) : target, mod));
26
+
27
+ //#endregion
28
+
29
+ exports.__toESM = __toESM;
package/dist/index.cjs CHANGED
@@ -1,7 +1,10 @@
1
1
  Object.defineProperty(exports, '__esModule', { value: true });
2
+ const require_rolldown_runtime = require('./_virtual/rolldown_runtime.cjs');
2
3
  const require_get_config_path = require('./powerlines/src/plugin-utils/get-config-path.cjs');
3
4
  let __storm_software_config_tools_types = require("@storm-software/config-tools/types");
4
5
  let __stryke_path_append = require("@stryke/path/append");
6
+ let defu = require("defu");
7
+ defu = require_rolldown_runtime.__toESM(defu);
5
8
  let nitro_builder = require("nitro/builder");
6
9
 
7
10
  //#region src/index.ts
@@ -9,55 +12,67 @@ let nitro_builder = require("nitro/builder");
9
12
  * A Powerlines plugin to integrate with Nitro.
10
13
  */
11
14
  const plugin = (options = {}) => {
12
- return [{
13
- name: "nitro:config",
14
- async config() {
15
- this.log(__storm_software_config_tools_types.LogLevelLabel.TRACE, "Providing default configuration for the Powerlines `nitro` plugin.");
16
- let configFile = options.configFile;
17
- if (!configFile) configFile = require_get_config_path.getConfigPath(this, "nitro");
18
- return { nitro: {
19
- configFile: configFile ? (0, __stryke_path_append.appendPath)(configFile, this.workspaceConfig.workspaceRoot) : void 0,
20
- ...options
21
- } };
22
- },
23
- configResolved() {
24
- this.config.nitro.compatibilityDate = this.config.compatibilityDate;
25
- this.config.nitro.workspaceDir = this.workspaceConfig.workspaceRoot;
26
- this.config.nitro.alias = this.config.build.alias;
27
- switch (this.config.logLevel) {
28
- case "error":
29
- this.config.nitro.logLevel = 1;
30
- break;
31
- case "warn":
32
- this.config.nitro.logLevel = 2;
33
- break;
34
- case "info":
35
- this.config.nitro.logLevel = 3;
36
- break;
37
- case "debug":
38
- this.config.nitro.logLevel = 4;
39
- break;
40
- case "trace":
41
- this.config.nitro.logLevel = 5;
42
- break;
43
- case null:
44
- this.config.nitro.logLevel = 0;
45
- break;
46
- default:
47
- this.config.nitro.logLevel = 2;
48
- break;
15
+ return [
16
+ {
17
+ name: "nitro:config",
18
+ async config() {
19
+ this.log(__storm_software_config_tools_types.LogLevelLabel.TRACE, "Providing default configuration for the Powerlines `nitro` plugin.");
20
+ let configFile = options.configFile;
21
+ if (!configFile) configFile = require_get_config_path.getConfigPath(this, "nitro");
22
+ return { nitro: {
23
+ configFile: configFile ? (0, __stryke_path_append.appendPath)(configFile, this.workspaceConfig.workspaceRoot) : void 0,
24
+ ...options
25
+ } };
26
+ },
27
+ configResolved() {
28
+ this.config.nitro.compatibilityDate = this.config.compatibilityDate;
29
+ this.config.nitro.workspaceDir = this.workspaceConfig.workspaceRoot;
30
+ this.config.nitro.alias = this.config.build.alias;
31
+ switch (this.config.logLevel) {
32
+ case "error":
33
+ this.config.nitro.logLevel = 1;
34
+ break;
35
+ case "warn":
36
+ this.config.nitro.logLevel = 2;
37
+ break;
38
+ case "info":
39
+ this.config.nitro.logLevel = 3;
40
+ break;
41
+ case "debug":
42
+ this.config.nitro.logLevel = 4;
43
+ break;
44
+ case "trace":
45
+ this.config.nitro.logLevel = 5;
46
+ break;
47
+ case null:
48
+ this.config.nitro.logLevel = 0;
49
+ break;
50
+ default:
51
+ this.config.nitro.logLevel = 2;
52
+ break;
53
+ }
49
54
  }
50
- }
51
- }, {
52
- name: "nitro:init",
53
- configResolved: {
54
- order: "post",
55
- async handler() {
56
- this.nitro ??= {};
57
- this.nitro.nitro = await (0, nitro_builder.createNitro)(this.config.nitro);
55
+ },
56
+ {
57
+ name: "nitro:init",
58
+ configResolved: {
59
+ order: "post",
60
+ async handler() {
61
+ this.nitro ??= {};
62
+ this.nitro.nitro = await (0, nitro_builder.createNitro)(this.config.nitro);
63
+ }
58
64
  }
65
+ },
66
+ {
67
+ name: "nitro:vite",
68
+ vite: { config(_, configEnv) {
69
+ this.config.nitro.dev = configEnv.command === "serve";
70
+ this.config.nitro.builder = "vite";
71
+ this.config.nitro.rootDir = this.config.projectRoot;
72
+ this.config.nitro = (0, defu.default)(this.config.nitro, this.config);
73
+ } }
59
74
  }
60
- }];
75
+ ];
61
76
  };
62
77
  var src_default = plugin;
63
78
 
package/dist/index.mjs CHANGED
@@ -1,6 +1,7 @@
1
1
  import { getConfigPath } from "./powerlines/src/plugin-utils/get-config-path.mjs";
2
2
  import { LogLevelLabel } from "@storm-software/config-tools/types";
3
3
  import { appendPath } from "@stryke/path/append";
4
+ import defu from "defu";
4
5
  import { createNitro } from "nitro/builder";
5
6
 
6
7
  //#region src/index.ts
@@ -8,55 +9,67 @@ import { createNitro } from "nitro/builder";
8
9
  * A Powerlines plugin to integrate with Nitro.
9
10
  */
10
11
  const plugin = (options = {}) => {
11
- return [{
12
- name: "nitro:config",
13
- async config() {
14
- this.log(LogLevelLabel.TRACE, "Providing default configuration for the Powerlines `nitro` plugin.");
15
- let configFile = options.configFile;
16
- if (!configFile) configFile = getConfigPath(this, "nitro");
17
- return { nitro: {
18
- configFile: configFile ? appendPath(configFile, this.workspaceConfig.workspaceRoot) : void 0,
19
- ...options
20
- } };
21
- },
22
- configResolved() {
23
- this.config.nitro.compatibilityDate = this.config.compatibilityDate;
24
- this.config.nitro.workspaceDir = this.workspaceConfig.workspaceRoot;
25
- this.config.nitro.alias = this.config.build.alias;
26
- switch (this.config.logLevel) {
27
- case "error":
28
- this.config.nitro.logLevel = 1;
29
- break;
30
- case "warn":
31
- this.config.nitro.logLevel = 2;
32
- break;
33
- case "info":
34
- this.config.nitro.logLevel = 3;
35
- break;
36
- case "debug":
37
- this.config.nitro.logLevel = 4;
38
- break;
39
- case "trace":
40
- this.config.nitro.logLevel = 5;
41
- break;
42
- case null:
43
- this.config.nitro.logLevel = 0;
44
- break;
45
- default:
46
- this.config.nitro.logLevel = 2;
47
- break;
12
+ return [
13
+ {
14
+ name: "nitro:config",
15
+ async config() {
16
+ this.log(LogLevelLabel.TRACE, "Providing default configuration for the Powerlines `nitro` plugin.");
17
+ let configFile = options.configFile;
18
+ if (!configFile) configFile = getConfigPath(this, "nitro");
19
+ return { nitro: {
20
+ configFile: configFile ? appendPath(configFile, this.workspaceConfig.workspaceRoot) : void 0,
21
+ ...options
22
+ } };
23
+ },
24
+ configResolved() {
25
+ this.config.nitro.compatibilityDate = this.config.compatibilityDate;
26
+ this.config.nitro.workspaceDir = this.workspaceConfig.workspaceRoot;
27
+ this.config.nitro.alias = this.config.build.alias;
28
+ switch (this.config.logLevel) {
29
+ case "error":
30
+ this.config.nitro.logLevel = 1;
31
+ break;
32
+ case "warn":
33
+ this.config.nitro.logLevel = 2;
34
+ break;
35
+ case "info":
36
+ this.config.nitro.logLevel = 3;
37
+ break;
38
+ case "debug":
39
+ this.config.nitro.logLevel = 4;
40
+ break;
41
+ case "trace":
42
+ this.config.nitro.logLevel = 5;
43
+ break;
44
+ case null:
45
+ this.config.nitro.logLevel = 0;
46
+ break;
47
+ default:
48
+ this.config.nitro.logLevel = 2;
49
+ break;
50
+ }
48
51
  }
49
- }
50
- }, {
51
- name: "nitro:init",
52
- configResolved: {
53
- order: "post",
54
- async handler() {
55
- this.nitro ??= {};
56
- this.nitro.nitro = await createNitro(this.config.nitro);
52
+ },
53
+ {
54
+ name: "nitro:init",
55
+ configResolved: {
56
+ order: "post",
57
+ async handler() {
58
+ this.nitro ??= {};
59
+ this.nitro.nitro = await createNitro(this.config.nitro);
60
+ }
57
61
  }
62
+ },
63
+ {
64
+ name: "nitro:vite",
65
+ vite: { config(_, configEnv) {
66
+ this.config.nitro.dev = configEnv.command === "serve";
67
+ this.config.nitro.builder = "vite";
68
+ this.config.nitro.rootDir = this.config.projectRoot;
69
+ this.config.nitro = defu(this.config.nitro, this.config);
70
+ } }
58
71
  }
59
- }];
72
+ ];
60
73
  };
61
74
  var src_default = plugin;
62
75
 
@@ -0,0 +1,47 @@
1
+ import { SelectHooksOptions } from "../../types/context.cjs";
2
+ import { MaybePromise } from "@stryke/types/base";
3
+
4
+ //#region ../powerlines/src/internal/helpers/hooks.d.ts
5
+ type CallHookOptions = SelectHooksOptions & (({
6
+ /**
7
+ * Whether to call the hooks sequentially or in parallel.
8
+ *
9
+ * @defaultValue true
10
+ */
11
+ sequential?: true;
12
+ } & ({
13
+ /**
14
+ * How to handle multiple return values from hooks.
15
+ * - "merge": Merge all non-undefined return values (if they are objects).
16
+ * - "first": Return the first non-undefined value.
17
+ *
18
+ * @remarks
19
+ * Merging only works if the return values are objects.
20
+ *
21
+ * @defaultValue "merge"
22
+ */
23
+ result: "first";
24
+ } | {
25
+ /**
26
+ * How to handle multiple return values from hooks.
27
+ * - "merge": Merge all non-undefined return values (if they are objects).
28
+ * - "first": Return the first non-undefined value.
29
+ *
30
+ * @remarks
31
+ * Merging only works if the return values are objects.
32
+ *
33
+ * @defaultValue "merge"
34
+ */
35
+ result?: "merge" | "last";
36
+ /**
37
+ * An indicator specifying if the results of the previous hook should be provided as the **first** parameter of the next hook function, or a function to process the result of the previous hook function and pass the returned value as the next hook's **first** parameter
38
+ */
39
+ asNextParam?: false | ((previousResult: any) => MaybePromise<any>);
40
+ })) | {
41
+ /**
42
+ * Whether to call the hooks sequentially or in parallel.
43
+ */
44
+ sequential: false;
45
+ });
46
+ //#endregion
47
+ export { CallHookOptions };
@@ -0,0 +1,49 @@
1
+ import "../../types/hooks.mjs";
2
+ import "../../types/resolved.mjs";
3
+ import { SelectHooksOptions } from "../../types/context.mjs";
4
+ import { MaybePromise } from "@stryke/types/base";
5
+
6
+ //#region ../powerlines/src/internal/helpers/hooks.d.ts
7
+ type CallHookOptions = SelectHooksOptions & (({
8
+ /**
9
+ * Whether to call the hooks sequentially or in parallel.
10
+ *
11
+ * @defaultValue true
12
+ */
13
+ sequential?: true;
14
+ } & ({
15
+ /**
16
+ * How to handle multiple return values from hooks.
17
+ * - "merge": Merge all non-undefined return values (if they are objects).
18
+ * - "first": Return the first non-undefined value.
19
+ *
20
+ * @remarks
21
+ * Merging only works if the return values are objects.
22
+ *
23
+ * @defaultValue "merge"
24
+ */
25
+ result: "first";
26
+ } | {
27
+ /**
28
+ * How to handle multiple return values from hooks.
29
+ * - "merge": Merge all non-undefined return values (if they are objects).
30
+ * - "first": Return the first non-undefined value.
31
+ *
32
+ * @remarks
33
+ * Merging only works if the return values are objects.
34
+ *
35
+ * @defaultValue "merge"
36
+ */
37
+ result?: "merge" | "last";
38
+ /**
39
+ * An indicator specifying if the results of the previous hook should be provided as the **first** parameter of the next hook function, or a function to process the result of the previous hook function and pass the returned value as the next hook's **first** parameter
40
+ */
41
+ asNextParam?: false | ((previousResult: any) => MaybePromise<any>);
42
+ })) | {
43
+ /**
44
+ * Whether to call the hooks sequentially or in parallel.
45
+ */
46
+ sequential: false;
47
+ });
48
+ //#endregion
49
+ export { CallHookOptions };
@@ -1,3 +1,4 @@
1
+ const require_rolldown_runtime = require('../../../_virtual/rolldown_runtime.cjs');
1
2
  let __stryke_path_join = require("@stryke/path/join");
2
3
  let node_fs = require("node:fs");
3
4
 
@@ -0,0 +1,104 @@
1
+ import { BuildInlineConfig, CleanInlineConfig, DeployInlineConfig, DocsInlineConfig, LintInlineConfig, NewInlineConfig, PrepareInlineConfig } from "./config.cjs";
2
+ import { InferHookParameters, InferHookReturnType } from "./hooks.cjs";
3
+ import { ResolvedConfig } from "./resolved.cjs";
4
+ import { APIContext, EnvironmentContext, PluginContext } from "./context.cjs";
5
+ import { CallHookOptions } from "../internal/helpers/hooks.cjs";
6
+
7
+ //#region ../powerlines/src/types/api.d.ts
8
+
9
+ /**
10
+ * Powerlines API Interface
11
+ */
12
+ interface API<TResolvedConfig extends ResolvedConfig = ResolvedConfig> {
13
+ /**
14
+ * The Powerlines shared API context
15
+ */
16
+ context: APIContext<TResolvedConfig>;
17
+ /**
18
+ * Prepare the Powerlines API
19
+ *
20
+ * @remarks
21
+ * This method will prepare the Powerlines API for use, initializing any necessary resources.
22
+ *
23
+ * @param inlineConfig - The inline configuration for the prepare command
24
+ */
25
+ prepare: (inlineConfig: PrepareInlineConfig | NewInlineConfig | CleanInlineConfig | BuildInlineConfig | LintInlineConfig | DocsInlineConfig | DeployInlineConfig) => Promise<void>;
26
+ /**
27
+ * Create a new Powerlines project
28
+ *
29
+ * @remarks
30
+ * This method will create a new Powerlines project in the current directory.
31
+ *
32
+ * @param inlineConfig - The inline configuration for the new command
33
+ * @returns A promise that resolves when the project has been created
34
+ */
35
+ new: (inlineConfig: NewInlineConfig) => Promise<void>;
36
+ /**
37
+ * Clean any previously prepared artifacts
38
+ *
39
+ * @remarks
40
+ * This method will remove the previous Powerlines artifacts from the project.
41
+ *
42
+ * @param inlineConfig - The inline configuration for the clean command
43
+ * @returns A promise that resolves when the clean command has completed
44
+ */
45
+ clean: (inlineConfig: CleanInlineConfig | PrepareInlineConfig) => Promise<void>;
46
+ /**
47
+ * Lint the project source code
48
+ *
49
+ * @param inlineConfig - The inline configuration for the lint command
50
+ * @returns A promise that resolves when the lint command has completed
51
+ */
52
+ lint: (inlineConfig: LintInlineConfig) => Promise<void>;
53
+ /**
54
+ * Build the project
55
+ *
56
+ * @remarks
57
+ * This method will build the Powerlines project, generating the necessary artifacts.
58
+ *
59
+ * @param inlineConfig - The inline configuration for the build command
60
+ * @returns A promise that resolves when the build command has completed
61
+ */
62
+ build: (inlineConfig: BuildInlineConfig) => Promise<void>;
63
+ /**
64
+ * Prepare the documentation for the project
65
+ *
66
+ * @param inlineConfig - The inline configuration for the docs command
67
+ * @returns A promise that resolves when the documentation generation has completed
68
+ */
69
+ docs: (inlineConfig: DocsInlineConfig) => Promise<void>;
70
+ /**
71
+ * Deploy the project source code
72
+ *
73
+ * @remarks
74
+ * This method will prepare and build the Powerlines project, generating the necessary artifacts for the deployment.
75
+ *
76
+ * @param inlineConfig - The inline configuration for the deploy command
77
+ */
78
+ deploy: (inlineConfig: DeployInlineConfig) => Promise<void>;
79
+ /**
80
+ * Finalization process
81
+ *
82
+ * @remarks
83
+ * This step includes any final processes or clean up required by Powerlines. It will be run after each Powerlines command.
84
+ *
85
+ * @returns A promise that resolves when the finalization process has completed
86
+ */
87
+ finalize: () => Promise<void>;
88
+ /**
89
+ * Invokes the configured plugin hooks
90
+ *
91
+ * @remarks
92
+ * By default, it will call the `"pre"`, `"normal"`, and `"post"` ordered hooks in sequence
93
+ *
94
+ * @param hook - The hook to call
95
+ * @param options - The options to provide to the hook
96
+ * @param args - The arguments to pass to the hook
97
+ * @returns The result of the hook call
98
+ */
99
+ callHook: <TKey extends string>(hook: TKey, options: CallHookOptions & {
100
+ environment?: string | EnvironmentContext<TResolvedConfig>;
101
+ }, ...args: InferHookParameters<PluginContext<TResolvedConfig>, TKey>) => Promise<InferHookReturnType<PluginContext<TResolvedConfig>, TKey> | undefined>;
102
+ }
103
+ //#endregion
104
+ export { API };
@@ -0,0 +1,104 @@
1
+ import { BuildInlineConfig, CleanInlineConfig, DeployInlineConfig, DocsInlineConfig, LintInlineConfig, NewInlineConfig, PrepareInlineConfig } from "./config.mjs";
2
+ import { InferHookParameters, InferHookReturnType } from "./hooks.mjs";
3
+ import { ResolvedConfig } from "./resolved.mjs";
4
+ import { APIContext, EnvironmentContext, PluginContext } from "./context.mjs";
5
+ import { CallHookOptions } from "../internal/helpers/hooks.mjs";
6
+
7
+ //#region ../powerlines/src/types/api.d.ts
8
+
9
+ /**
10
+ * Powerlines API Interface
11
+ */
12
+ interface API<TResolvedConfig extends ResolvedConfig = ResolvedConfig> {
13
+ /**
14
+ * The Powerlines shared API context
15
+ */
16
+ context: APIContext<TResolvedConfig>;
17
+ /**
18
+ * Prepare the Powerlines API
19
+ *
20
+ * @remarks
21
+ * This method will prepare the Powerlines API for use, initializing any necessary resources.
22
+ *
23
+ * @param inlineConfig - The inline configuration for the prepare command
24
+ */
25
+ prepare: (inlineConfig: PrepareInlineConfig | NewInlineConfig | CleanInlineConfig | BuildInlineConfig | LintInlineConfig | DocsInlineConfig | DeployInlineConfig) => Promise<void>;
26
+ /**
27
+ * Create a new Powerlines project
28
+ *
29
+ * @remarks
30
+ * This method will create a new Powerlines project in the current directory.
31
+ *
32
+ * @param inlineConfig - The inline configuration for the new command
33
+ * @returns A promise that resolves when the project has been created
34
+ */
35
+ new: (inlineConfig: NewInlineConfig) => Promise<void>;
36
+ /**
37
+ * Clean any previously prepared artifacts
38
+ *
39
+ * @remarks
40
+ * This method will remove the previous Powerlines artifacts from the project.
41
+ *
42
+ * @param inlineConfig - The inline configuration for the clean command
43
+ * @returns A promise that resolves when the clean command has completed
44
+ */
45
+ clean: (inlineConfig: CleanInlineConfig | PrepareInlineConfig) => Promise<void>;
46
+ /**
47
+ * Lint the project source code
48
+ *
49
+ * @param inlineConfig - The inline configuration for the lint command
50
+ * @returns A promise that resolves when the lint command has completed
51
+ */
52
+ lint: (inlineConfig: LintInlineConfig) => Promise<void>;
53
+ /**
54
+ * Build the project
55
+ *
56
+ * @remarks
57
+ * This method will build the Powerlines project, generating the necessary artifacts.
58
+ *
59
+ * @param inlineConfig - The inline configuration for the build command
60
+ * @returns A promise that resolves when the build command has completed
61
+ */
62
+ build: (inlineConfig: BuildInlineConfig) => Promise<void>;
63
+ /**
64
+ * Prepare the documentation for the project
65
+ *
66
+ * @param inlineConfig - The inline configuration for the docs command
67
+ * @returns A promise that resolves when the documentation generation has completed
68
+ */
69
+ docs: (inlineConfig: DocsInlineConfig) => Promise<void>;
70
+ /**
71
+ * Deploy the project source code
72
+ *
73
+ * @remarks
74
+ * This method will prepare and build the Powerlines project, generating the necessary artifacts for the deployment.
75
+ *
76
+ * @param inlineConfig - The inline configuration for the deploy command
77
+ */
78
+ deploy: (inlineConfig: DeployInlineConfig) => Promise<void>;
79
+ /**
80
+ * Finalization process
81
+ *
82
+ * @remarks
83
+ * This step includes any final processes or clean up required by Powerlines. It will be run after each Powerlines command.
84
+ *
85
+ * @returns A promise that resolves when the finalization process has completed
86
+ */
87
+ finalize: () => Promise<void>;
88
+ /**
89
+ * Invokes the configured plugin hooks
90
+ *
91
+ * @remarks
92
+ * By default, it will call the `"pre"`, `"normal"`, and `"post"` ordered hooks in sequence
93
+ *
94
+ * @param hook - The hook to call
95
+ * @param options - The options to provide to the hook
96
+ * @param args - The arguments to pass to the hook
97
+ * @returns The result of the hook call
98
+ */
99
+ callHook: <TKey extends string>(hook: TKey, options: CallHookOptions & {
100
+ environment?: string | EnvironmentContext<TResolvedConfig>;
101
+ }, ...args: InferHookParameters<PluginContext<TResolvedConfig>, TKey>) => Promise<InferHookReturnType<PluginContext<TResolvedConfig>, TKey> | undefined>;
102
+ }
103
+ //#endregion
104
+ export { API };
@@ -1,6 +1,18 @@
1
- //#region ../powerlines/src/types/build.d.ts
1
+ import { OutputOptions, RollupOptions } from "rollup";
2
+ import { UserConfig } from "@farmfe/core";
3
+ import { Configuration } from "@rspack/core";
4
+ import { BuildOptions } from "@storm-software/tsup/types";
5
+ import { UnbuildOptions } from "@storm-software/unbuild/types";
6
+ import { BuildOptions as BuildOptions$1 } from "esbuild";
7
+ import { RolldownOptions } from "rolldown";
8
+ import { UserConfig as UserConfig$1 } from "tsdown";
9
+ import { DepOptimizationOptions, UserConfig as UserConfig$2 } from "vite";
10
+ import { Configuration as Configuration$1 } from "webpack";
2
11
 
3
- type UnpluginBuildVariant = "rollup" | "webpack" | "rspack" | "vite" | "esbuild" | "farm" | "unloader" | "rolldown";
12
+ //#region ../powerlines/src/types/build.d.ts
13
+ type UnpluginBuilderVariant = "rollup" | "webpack" | "rspack" | "vite" | "esbuild" | "farm" | "unloader" | "rolldown" | "bun";
14
+ type BuilderVariant = UnpluginBuilderVariant | "tsup" | "tsdown" | "unbuild";
15
+ type InferUnpluginVariant<TBuildVariant extends BuilderVariant> = TBuildVariant extends "tsup" ? "esbuild" : TBuildVariant extends "tsdown" ? "rolldown" : TBuildVariant extends "unbuild" ? "rollup" : TBuildVariant;
4
16
  interface BuildConfig {
5
17
  /**
6
18
  * The platform to build the project for
@@ -141,5 +153,33 @@ interface BuildConfig {
141
153
  override?: Record<string, any>;
142
154
  }
143
155
  type BuildResolvedConfig = Omit<BuildConfig, "override">;
156
+ type ESBuildBuildConfig = Omit<BuildOptions$1, "entryPoints" | "sourceRoot" | "platform" | "outdir" | "env" | "assets" | "external" | "inject" | "tsconfig" | "tsconfigRaw" | "logLevel"> & BuildConfig;
157
+ type ESBuildResolvedBuildConfig = Omit<BuildOptions$1, "inject"> & BuildResolvedConfig;
158
+ type ViteBuildConfig = Omit<UserConfig$2, "entry" | "entryPoints" | "tsconfig" | "tsconfigRaw" | "environments" | "output"> & BuildConfig & {
159
+ /**
160
+ * Optimize deps config
161
+ */
162
+ optimizeDeps?: Omit<DepOptimizationOptions, "extensions">;
163
+ };
164
+ type ViteResolvedBuildConfig = UserConfig$2 & BuildResolvedConfig;
165
+ type WebpackBuildConfig = Omit<Configuration$1, "name" | "entry" | "entryPoints" | "tsconfig" | "tsconfigRaw"> & BuildConfig;
166
+ type WebpackResolvedBuildConfig = Configuration$1 & BuildResolvedConfig;
167
+ type RspackBuildConfig = Omit<Configuration, "name" | "entry" | "entryPoints" | "tsconfig" | "tsconfigRaw"> & BuildConfig;
168
+ type RspackResolvedBuildConfig = Configuration & BuildResolvedConfig;
169
+ type RollupBuildOutputConfig = Omit<OutputOptions, "dir" | "format">;
170
+ type RollupBuildConfig = Omit<RollupOptions, "entry" | "external" | "input" | "output" | "logLevel"> & {
171
+ output: RollupBuildOutputConfig | RollupBuildOutputConfig[];
172
+ } & BuildConfig;
173
+ type RollupResolvedBuildConfig = RollupOptions & BuildResolvedConfig;
174
+ type RolldownBuildConfig = Omit<RolldownOptions, "input" | "external" | "tsconfig" | "logLevel" | "output"> & BuildConfig;
175
+ type RolldownResolvedBuildConfig = RolldownOptions & BuildResolvedConfig;
176
+ type TsupBuildConfig = Partial<Omit<BuildOptions, "userOptions" | "tsconfig" | "tsconfigRaw" | "assets" | "outputPath" | "mode" | "format" | "platform" | "projectRoot" | "clean" | "env" | "entry" | "entryPoints" | "external" | "noExternal" | "skipNodeModulesBundle">> & BuildConfig;
177
+ type TsupResolvedBuildConfig = BuildOptions & BuildResolvedConfig;
178
+ type TsdownBuildConfig = Partial<Omit<UserConfig$1, "name" | "outDir" | "clean" | "cwd" | "tsconfig" | "publicDir" | "copy" | "alias" | "format" | "platform" | "env" | "define" | "entry" | "external" | "noExternal" | "skipNodeModulesBundle">> & BuildConfig;
179
+ type TsdownResolvedBuildConfig = UserConfig$1 & BuildResolvedConfig;
180
+ type UnbuildBuildConfig = Partial<Omit<UnbuildOptions, "tsconfig" | "tsconfigRaw" | "assets" | "outputPath" | "mode" | "format" | "platform" | "projectRoot" | "env" | "entry" | "entryPoints">> & BuildConfig;
181
+ type UnbuildResolvedBuildConfig = UnbuildOptions & BuildResolvedConfig;
182
+ type FarmBuildConfig = Partial<Omit<UserConfig, "tsconfig" | "tsconfigRaw" | "assets" | "outputPath" | "mode" | "format" | "platform" | "projectRoot" | "env" | "entry" | "entryPoints">> & BuildConfig;
183
+ type FarmResolvedBuildConfig = UserConfig & BuildResolvedConfig;
144
184
  //#endregion
145
- export { BuildConfig, BuildResolvedConfig, UnpluginBuildVariant };
185
+ export { BuildConfig, BuildResolvedConfig, BuilderVariant, ESBuildBuildConfig, ESBuildResolvedBuildConfig, FarmBuildConfig, FarmResolvedBuildConfig, InferUnpluginVariant, RolldownBuildConfig, RolldownResolvedBuildConfig, RollupBuildConfig, RollupResolvedBuildConfig, RspackBuildConfig, RspackResolvedBuildConfig, TsdownBuildConfig, TsdownResolvedBuildConfig, TsupBuildConfig, TsupResolvedBuildConfig, UnbuildBuildConfig, UnbuildResolvedBuildConfig, UnpluginBuilderVariant, ViteBuildConfig, ViteResolvedBuildConfig, WebpackBuildConfig, WebpackResolvedBuildConfig };