@powerlines/plugin-alloy 0.18.7 → 0.18.9

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.
Files changed (43) hide show
  1. package/dist/core/components/output.d.cts +2 -2
  2. package/dist/core/components/output.d.mts +2 -2
  3. package/dist/core/components/source-file.d.cts +2 -2
  4. package/dist/index.cjs +12 -5
  5. package/dist/index.mjs +12 -5
  6. package/dist/markdown/components/markdown-file.d.cts +3 -3
  7. package/dist/markdown/components/markdown-table.d.cts +4 -4
  8. package/dist/markdown/components/markdown-table.d.mts +4 -4
  9. package/dist/powerlines/src/internal/helpers/hooks.d.cts +47 -0
  10. package/dist/powerlines/src/internal/helpers/hooks.d.mts +47 -0
  11. package/dist/powerlines/src/types/api.d.cts +104 -0
  12. package/dist/powerlines/src/types/api.d.mts +104 -0
  13. package/dist/powerlines/src/types/build.d.cts +43 -3
  14. package/dist/powerlines/src/types/build.d.mts +43 -3
  15. package/dist/powerlines/src/types/config.d.cts +60 -4
  16. package/dist/powerlines/src/types/config.d.mts +60 -4
  17. package/dist/powerlines/src/types/context.d.cts +113 -1
  18. package/dist/powerlines/src/types/context.d.mts +113 -1
  19. package/dist/powerlines/src/types/hooks.d.cts +32 -0
  20. package/dist/powerlines/src/types/hooks.d.mts +32 -0
  21. package/dist/powerlines/src/types/plugin.d.cts +35 -61
  22. package/dist/powerlines/src/types/plugin.d.mts +35 -61
  23. package/dist/powerlines/src/types/resolved.d.cts +16 -4
  24. package/dist/powerlines/src/types/resolved.d.mts +16 -4
  25. package/dist/powerlines/src/types/unplugin.d.cts +22 -0
  26. package/dist/powerlines/src/types/unplugin.d.mts +22 -0
  27. package/dist/types/components.d.cts +1 -3
  28. package/dist/types/components.d.mts +1 -3
  29. package/dist/typescript/components/builtin-file.d.cts +2 -2
  30. package/dist/typescript/components/builtin-file.d.mts +2 -2
  31. package/dist/typescript/components/dynamic-import-statement.d.cts +2 -2
  32. package/dist/typescript/components/dynamic-import-statement.d.mts +2 -2
  33. package/dist/typescript/components/entry-file.d.cts +2 -2
  34. package/dist/typescript/components/tsdoc-reflection.d.cts +4 -4
  35. package/dist/typescript/components/typescript-file.cjs +16 -10
  36. package/dist/typescript/components/typescript-file.d.cts +2 -0
  37. package/dist/typescript/components/typescript-file.d.mts +2 -0
  38. package/dist/typescript/components/typescript-file.mjs +16 -10
  39. package/dist/typescript/components/typescript-interface.d.cts +3 -3
  40. package/dist/typescript/components/typescript-interface.d.mts +3 -3
  41. package/dist/typescript/components/typescript-object.d.cts +3 -3
  42. package/dist/typescript/components/typescript-object.d.mts +3 -3
  43. package/package.json +5 -5
@@ -1,6 +1,6 @@
1
1
  import { PluginContext } from "../../powerlines/src/types/context.cjs";
2
2
  import { MetaItem } from "../contexts/context.cjs";
3
- import * as _alloy_js_core0 from "@alloy-js/core";
3
+ import * as _alloy_js_core6 from "@alloy-js/core";
4
4
  import { OutputProps as OutputProps$1 } from "@alloy-js/core";
5
5
 
6
6
  //#region src/core/components/output.d.ts
@@ -17,7 +17,7 @@ interface OutputProps<TContext extends PluginContext = PluginContext, TMeta exte
17
17
  /**
18
18
  * Output component for rendering the Powerlines plugin's output files via templates.
19
19
  */
20
- declare function Output<TContext extends PluginContext = PluginContext, TMeta extends Record<string, MetaItem> = Record<string, MetaItem>>(props: OutputProps<TContext, TMeta>): _alloy_js_core0.Children;
20
+ declare function Output<TContext extends PluginContext = PluginContext, TMeta extends Record<string, MetaItem> = Record<string, MetaItem>>(props: OutputProps<TContext, TMeta>): _alloy_js_core6.Children;
21
21
  declare type __ΩOutputProps = any[];
22
22
  //#endregion
23
23
  export { Output, OutputProps, __ΩOutputProps };
@@ -1,6 +1,6 @@
1
1
  import { PluginContext } from "../../powerlines/src/types/context.mjs";
2
2
  import { MetaItem } from "../contexts/context.mjs";
3
- import * as _alloy_js_core1 from "@alloy-js/core";
3
+ import * as _alloy_js_core4 from "@alloy-js/core";
4
4
  import { OutputProps as OutputProps$1 } from "@alloy-js/core";
5
5
 
6
6
  //#region src/core/components/output.d.ts
@@ -17,7 +17,7 @@ interface OutputProps<TContext extends PluginContext = PluginContext, TMeta exte
17
17
  /**
18
18
  * Output component for rendering the Powerlines plugin's output files via templates.
19
19
  */
20
- declare function Output<TContext extends PluginContext = PluginContext, TMeta extends Record<string, MetaItem> = Record<string, MetaItem>>(props: OutputProps<TContext, TMeta>): _alloy_js_core1.Children;
20
+ declare function Output<TContext extends PluginContext = PluginContext, TMeta extends Record<string, MetaItem> = Record<string, MetaItem>>(props: OutputProps<TContext, TMeta>): _alloy_js_core4.Children;
21
21
  declare type __ΩOutputProps = any[];
22
22
  //#endregion
23
23
  export { Output, OutputProps, __ΩOutputProps };
@@ -1,6 +1,6 @@
1
1
  import { StoragePreset } from "../../powerlines/src/types/fs.cjs";
2
2
  import { ComponentProps } from "../../types/components.cjs";
3
- import * as _alloy_js_core1 from "@alloy-js/core";
3
+ import * as _alloy_js_core3 from "@alloy-js/core";
4
4
  import { SourceFileProps as SourceFileProps$1 } from "@alloy-js/core";
5
5
 
6
6
  //#region src/core/components/source-file.d.ts
@@ -26,7 +26,7 @@ type SourceFileProps = SourceFileProps$1 & ComponentProps & {
26
26
  * @param props - The properties for the source file.
27
27
  * @returns The rendered source file component.
28
28
  */
29
- declare function SourceFile(props: SourceFileProps): _alloy_js_core1.Children;
29
+ declare function SourceFile(props: SourceFileProps): _alloy_js_core3.Children;
30
30
  declare type __ΩSourceFileProps = any[];
31
31
  //#endregion
32
32
  export { SourceFile, SourceFileProps, __ΩSourceFileProps };
package/dist/index.cjs CHANGED
@@ -24,11 +24,18 @@ const plugin = (options = {}) => {
24
24
  ...options
25
25
  },
26
26
  build: {
27
- inputOptions: { transform: { jsx: {
28
- runtime: "classic",
29
- pragma: "Alloy.createElement",
30
- importSource: "@alloy-js/core"
31
- } } },
27
+ inputOptions: { transform: {
28
+ typescript: {
29
+ jsxPragma: "Alloy.createElement",
30
+ jsxPragmaFrag: "Alloy.Fragment"
31
+ },
32
+ jsx: {
33
+ runtime: "classic",
34
+ pragma: "Alloy.createElement",
35
+ pragmaFrag: "Alloy.Fragment",
36
+ importSource: "@alloy-js/core"
37
+ }
38
+ } },
32
39
  plugins: [(0, __alloy_js_rollup_plugin.default)()],
33
40
  external: [
34
41
  "@alloy-js/core",
package/dist/index.mjs CHANGED
@@ -21,11 +21,18 @@ const plugin = (options = {}) => {
21
21
  ...options
22
22
  },
23
23
  build: {
24
- inputOptions: { transform: { jsx: {
25
- runtime: "classic",
26
- pragma: "Alloy.createElement",
27
- importSource: "@alloy-js/core"
28
- } } },
24
+ inputOptions: { transform: {
25
+ typescript: {
26
+ jsxPragma: "Alloy.createElement",
27
+ jsxPragmaFrag: "Alloy.Fragment"
28
+ },
29
+ jsx: {
30
+ runtime: "classic",
31
+ pragma: "Alloy.createElement",
32
+ pragmaFrag: "Alloy.Fragment",
33
+ importSource: "@alloy-js/core"
34
+ }
35
+ } },
29
36
  plugins: [alloy()],
30
37
  external: [
31
38
  "@alloy-js/core",
@@ -1,6 +1,6 @@
1
1
  import { ComponentProps, SourceFileHeaderProps } from "../../types/components.cjs";
2
2
  import { SourceFileProps as SourceFileProps$1 } from "../../core/components/source-file.cjs";
3
- import * as _alloy_js_core8 from "@alloy-js/core";
3
+ import * as _alloy_js_core15 from "@alloy-js/core";
4
4
 
5
5
  //#region src/markdown/components/markdown-file.d.ts
6
6
  type MarkdownFileProps = Omit<SourceFileProps$1, "filetype"> & ComponentProps;
@@ -10,14 +10,14 @@ type MarkdownFileProps = Omit<SourceFileProps$1, "filetype"> & ComponentProps;
10
10
  * @param props - The properties for the source file.
11
11
  * @returns The rendered source file component.
12
12
  */
13
- declare function MarkdownFile(props: MarkdownFileProps): _alloy_js_core8.Children;
13
+ declare function MarkdownFile(props: MarkdownFileProps): _alloy_js_core15.Children;
14
14
  /**
15
15
  * Renders the header for a Powerlines Typescript source file.
16
16
  *
17
17
  * @param props - The properties for the source file header.
18
18
  * @returns The rendered source file header.
19
19
  */
20
- declare function MarkdownFileHeader(props: SourceFileHeaderProps): _alloy_js_core8.Children;
20
+ declare function MarkdownFileHeader(props: SourceFileHeaderProps): _alloy_js_core15.Children;
21
21
  declare type __ΩMarkdownFileProps = any[];
22
22
  //#endregion
23
23
  export { MarkdownFile, MarkdownFileHeader, MarkdownFileProps, __ΩMarkdownFileProps };
@@ -1,6 +1,6 @@
1
1
  import { ComponentProps } from "../../types/components.cjs";
2
2
  import { MarkdownTableColumnContextInterface } from "../contexts/markdown-table.cjs";
3
- import * as _alloy_js_core10 from "@alloy-js/core";
3
+ import * as _alloy_js_core9 from "@alloy-js/core";
4
4
 
5
5
  //#region src/markdown/components/markdown-table.d.ts
6
6
  interface MarkdownTableProps<T extends Record<string, any> = Record<string, any>> extends ComponentProps {
@@ -9,18 +9,18 @@ interface MarkdownTableProps<T extends Record<string, any> = Record<string, any>
9
9
  /**
10
10
  * Component that provides a context for rendering markdown tables.
11
11
  */
12
- declare function MarkdownTable<T extends Record<string, any> = Record<string, any>>(props: MarkdownTableProps<T>): _alloy_js_core10.Children;
12
+ declare function MarkdownTable<T extends Record<string, any> = Record<string, any>>(props: MarkdownTableProps<T>): _alloy_js_core9.Children;
13
13
  type MarkdownTableColumnProps = ComponentProps & Partial<Pick<MarkdownTableColumnContextInterface, "align">> & Required<Pick<MarkdownTableColumnContextInterface, "name">> & {
14
14
  width?: number;
15
15
  };
16
16
  /**
17
17
  * Component that provides a context for rendering markdown tables.
18
18
  */
19
- declare function MarkdownTableColumn(props: MarkdownTableColumnProps): _alloy_js_core10.Children;
19
+ declare function MarkdownTableColumn(props: MarkdownTableColumnProps): _alloy_js_core9.Children;
20
20
  /**
21
21
  * Component that provides a context for rendering markdown tables.
22
22
  */
23
- declare function MarkdownTableColumnHeader(props: MarkdownTableColumnProps): _alloy_js_core10.Children;
23
+ declare function MarkdownTableColumnHeader(props: MarkdownTableColumnProps): _alloy_js_core9.Children;
24
24
  declare type __ΩMarkdownTableProps = any[];
25
25
  declare type __ΩMarkdownTableColumnProps = any[];
26
26
  //#endregion
@@ -1,6 +1,6 @@
1
1
  import { ComponentProps } from "../../types/components.mjs";
2
2
  import { MarkdownTableColumnContextInterface } from "../contexts/markdown-table.mjs";
3
- import * as _alloy_js_core2 from "@alloy-js/core";
3
+ import * as _alloy_js_core1 from "@alloy-js/core";
4
4
 
5
5
  //#region src/markdown/components/markdown-table.d.ts
6
6
  interface MarkdownTableProps<T extends Record<string, any> = Record<string, any>> extends ComponentProps {
@@ -9,18 +9,18 @@ interface MarkdownTableProps<T extends Record<string, any> = Record<string, any>
9
9
  /**
10
10
  * Component that provides a context for rendering markdown tables.
11
11
  */
12
- declare function MarkdownTable<T extends Record<string, any> = Record<string, any>>(props: MarkdownTableProps<T>): _alloy_js_core2.Children;
12
+ declare function MarkdownTable<T extends Record<string, any> = Record<string, any>>(props: MarkdownTableProps<T>): _alloy_js_core1.Children;
13
13
  type MarkdownTableColumnProps = ComponentProps & Partial<Pick<MarkdownTableColumnContextInterface, "align">> & Required<Pick<MarkdownTableColumnContextInterface, "name">> & {
14
14
  width?: number;
15
15
  };
16
16
  /**
17
17
  * Component that provides a context for rendering markdown tables.
18
18
  */
19
- declare function MarkdownTableColumn(props: MarkdownTableColumnProps): _alloy_js_core2.Children;
19
+ declare function MarkdownTableColumn(props: MarkdownTableColumnProps): _alloy_js_core1.Children;
20
20
  /**
21
21
  * Component that provides a context for rendering markdown tables.
22
22
  */
23
- declare function MarkdownTableColumnHeader(props: MarkdownTableColumnProps): _alloy_js_core2.Children;
23
+ declare function MarkdownTableColumnHeader(props: MarkdownTableColumnProps): _alloy_js_core1.Children;
24
24
  declare type __ΩMarkdownTableProps = any[];
25
25
  declare type __ΩMarkdownTableColumnProps = any[];
26
26
  //#endregion
@@ -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,47 @@
1
+ import { SelectHooksOptions } from "../../types/context.mjs";
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,104 @@
1
+ import { ResolvedConfig } from "./resolved.cjs";
2
+ import { InferHookParameters, InferHookReturnType } from "./hooks.cjs";
3
+ import { CallHookOptions } from "../internal/helpers/hooks.cjs";
4
+ import { BuildInlineConfig, CleanInlineConfig, DeployInlineConfig, DocsInlineConfig, LintInlineConfig, NewInlineConfig, PrepareInlineConfig } from "./config.cjs";
5
+ import { APIContext, EnvironmentContext, PluginContext } from "./context.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 { ResolvedConfig } from "./resolved.mjs";
2
+ import { InferHookParameters, InferHookReturnType } from "./hooks.mjs";
3
+ import { CallHookOptions } from "../internal/helpers/hooks.mjs";
4
+ import { BuildInlineConfig, CleanInlineConfig, DeployInlineConfig, DocsInlineConfig, LintInlineConfig, NewInlineConfig, PrepareInlineConfig } from "./config.mjs";
5
+ import { APIContext, EnvironmentContext, PluginContext } from "./context.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 { DepOptimizationOptions, UserConfig } from "vite";
2
+ import { UserConfig as UserConfig$1 } 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 { OutputOptions, RollupOptions } from "rollup";
9
+ import { UserConfig as UserConfig$2 } from "tsdown";
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, "entry" | "entryPoints" | "tsconfig" | "tsconfigRaw" | "environments" | "output"> & BuildConfig & {
159
+ /**
160
+ * Optimize deps config
161
+ */
162
+ optimizeDeps?: Omit<DepOptimizationOptions, "extensions">;
163
+ };
164
+ type ViteResolvedBuildConfig = UserConfig & 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$2, "name" | "outDir" | "clean" | "cwd" | "tsconfig" | "publicDir" | "copy" | "alias" | "format" | "platform" | "env" | "define" | "entry" | "external" | "noExternal" | "skipNodeModulesBundle">> & BuildConfig;
179
+ type TsdownResolvedBuildConfig = UserConfig$2 & 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$1, "tsconfig" | "tsconfigRaw" | "assets" | "outputPath" | "mode" | "format" | "platform" | "projectRoot" | "env" | "entry" | "entryPoints">> & BuildConfig;
183
+ type FarmResolvedBuildConfig = UserConfig$1 & 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 };
@@ -1,6 +1,18 @@
1
- //#region ../powerlines/src/types/build.d.ts
1
+ import { DepOptimizationOptions, UserConfig } from "vite";
2
+ import { UserConfig as UserConfig$1 } 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 { OutputOptions, RollupOptions } from "rollup";
9
+ import { UserConfig as UserConfig$2 } from "tsdown";
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, "entry" | "entryPoints" | "tsconfig" | "tsconfigRaw" | "environments" | "output"> & BuildConfig & {
159
+ /**
160
+ * Optimize deps config
161
+ */
162
+ optimizeDeps?: Omit<DepOptimizationOptions, "extensions">;
163
+ };
164
+ type ViteResolvedBuildConfig = UserConfig & 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$2, "name" | "outDir" | "clean" | "cwd" | "tsconfig" | "publicDir" | "copy" | "alias" | "format" | "platform" | "env" | "define" | "entry" | "external" | "noExternal" | "skipNodeModulesBundle">> & BuildConfig;
179
+ type TsdownResolvedBuildConfig = UserConfig$2 & 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$1, "tsconfig" | "tsconfigRaw" | "assets" | "outputPath" | "mode" | "format" | "platform" | "projectRoot" | "env" | "entry" | "entryPoints">> & BuildConfig;
183
+ type FarmResolvedBuildConfig = UserConfig$1 & 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 };