@powerlines/plugin-capnp 0.1.235 → 0.1.237

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 (33) hide show
  1. package/dist/index.cjs +2 -2
  2. package/dist/index.d.cts +2 -1
  3. package/dist/index.d.mts +2 -1
  4. package/dist/index.mjs +1 -1
  5. package/dist/types/plugin.d.cts +3 -3
  6. package/dist/types/plugin.d.mts +3 -3
  7. package/package.json +60 -13
  8. package/dist/powerlines/src/internal/helpers/hooks.d.cts +0 -47
  9. package/dist/powerlines/src/internal/helpers/hooks.d.mts +0 -47
  10. package/dist/powerlines/src/plugin-utils/paths.cjs +0 -36
  11. package/dist/powerlines/src/plugin-utils/paths.mjs +0 -35
  12. package/dist/powerlines/src/types/api.d.cts +0 -104
  13. package/dist/powerlines/src/types/api.d.mts +0 -104
  14. package/dist/powerlines/src/types/build.d.cts +0 -185
  15. package/dist/powerlines/src/types/build.d.mts +0 -185
  16. package/dist/powerlines/src/types/commands.d.cts +0 -8
  17. package/dist/powerlines/src/types/commands.d.mts +0 -8
  18. package/dist/powerlines/src/types/config.d.cts +0 -424
  19. package/dist/powerlines/src/types/config.d.mts +0 -424
  20. package/dist/powerlines/src/types/context.d.cts +0 -514
  21. package/dist/powerlines/src/types/context.d.mts +0 -514
  22. package/dist/powerlines/src/types/fs.d.cts +0 -486
  23. package/dist/powerlines/src/types/fs.d.mts +0 -486
  24. package/dist/powerlines/src/types/hooks.d.cts +0 -32
  25. package/dist/powerlines/src/types/hooks.d.mts +0 -32
  26. package/dist/powerlines/src/types/plugin.d.cts +0 -205
  27. package/dist/powerlines/src/types/plugin.d.mts +0 -205
  28. package/dist/powerlines/src/types/resolved.d.cts +0 -93
  29. package/dist/powerlines/src/types/resolved.d.mts +0 -93
  30. package/dist/powerlines/src/types/tsconfig.d.cts +0 -69
  31. package/dist/powerlines/src/types/tsconfig.d.mts +0 -69
  32. package/dist/powerlines/src/types/unplugin.d.cts +0 -22
  33. package/dist/powerlines/src/types/unplugin.d.mts +0 -22
package/dist/index.cjs CHANGED
@@ -1,6 +1,5 @@
1
1
  Object.defineProperty(exports, '__esModule', { value: true });
2
2
  const require_rolldown_runtime = require('./_virtual/rolldown_runtime.cjs');
3
- const require_paths = require('./powerlines/src/plugin-utils/paths.cjs');
4
3
  let __stryke_capnp_compile = require("@stryke/capnp/compile");
5
4
  let __stryke_capnp_helpers = require("@stryke/capnp/helpers");
6
5
  let __stryke_path_file_path_fns = require("@stryke/path/file-path-fns");
@@ -9,6 +8,7 @@ let __stryke_path_join_paths = require("@stryke/path/join-paths");
9
8
  let __stryke_path_replace = require("@stryke/path/replace");
10
9
  let defu = require("defu");
11
10
  defu = require_rolldown_runtime.__toESM(defu);
11
+ let powerlines_plugin_utils_paths = require("powerlines/plugin-utils/paths");
12
12
 
13
13
  //#region src/index.ts
14
14
  /**
@@ -32,7 +32,7 @@ const plugin = (options = {}) => {
32
32
  }) };
33
33
  },
34
34
  configResolved() {
35
- this.config.capnp.outputPath = require_paths.replacePathTokens(this, this.config.capnp.outputPath);
35
+ this.config.capnp.outputPath = (0, powerlines_plugin_utils_paths.replacePathTokens)(this, this.config.capnp.outputPath);
36
36
  },
37
37
  async prepare() {
38
38
  const resolvedOptions = await (0, __stryke_capnp_helpers.resolveOptions)({
package/dist/index.d.cts CHANGED
@@ -1,5 +1,6 @@
1
- import { Plugin } from "./powerlines/src/types/plugin.cjs";
2
1
  import { CapnpPluginContext, CapnpPluginOptions, CapnpPluginResolvedConfig, CapnpPluginUserConfig, __ΩCapnpPluginContext, __ΩCapnpPluginOptions, __ΩCapnpPluginResolvedConfig, __ΩCapnpPluginUserConfig } from "./types/plugin.cjs";
2
+ import "./types/index.cjs";
3
+ import { Plugin } from "powerlines/types/plugin";
3
4
 
4
5
  //#region src/index.d.ts
5
6
 
package/dist/index.d.mts CHANGED
@@ -1,5 +1,6 @@
1
- import { Plugin } from "./powerlines/src/types/plugin.mjs";
2
1
  import { CapnpPluginContext, CapnpPluginOptions, CapnpPluginResolvedConfig, CapnpPluginUserConfig, __ΩCapnpPluginContext, __ΩCapnpPluginOptions, __ΩCapnpPluginResolvedConfig, __ΩCapnpPluginUserConfig } from "./types/plugin.mjs";
2
+ import "./types/index.mjs";
3
+ import { Plugin } from "powerlines/types/plugin";
3
4
 
4
5
  //#region src/index.d.ts
5
6
 
package/dist/index.mjs CHANGED
@@ -1,4 +1,3 @@
1
- import { replacePathTokens } from "./powerlines/src/plugin-utils/paths.mjs";
2
1
  import { capnpc } from "@stryke/capnp/compile";
3
2
  import { resolveOptions } from "@stryke/capnp/helpers";
4
3
  import { findFileName } from "@stryke/path/file-path-fns";
@@ -6,6 +5,7 @@ import { isParentPath } from "@stryke/path/is-parent-path";
6
5
  import { joinPaths } from "@stryke/path/join-paths";
7
6
  import { replacePath } from "@stryke/path/replace";
8
7
  import defu from "defu";
8
+ import { replacePathTokens } from "powerlines/plugin-utils/paths";
9
9
 
10
10
  //#region src/index.ts
11
11
  /**
@@ -1,7 +1,7 @@
1
- import { UserConfig } from "../powerlines/src/types/config.cjs";
2
- import { ResolvedConfig } from "../powerlines/src/types/resolved.cjs";
3
- import { PluginContext } from "../powerlines/src/types/context.cjs";
4
1
  import { CapnpcOptions } from "@stryke/capnp/types";
2
+ import { UserConfig } from "powerlines/types/config";
3
+ import { PluginContext } from "powerlines/types/context";
4
+ import { ResolvedConfig } from "powerlines/types/resolved";
5
5
 
6
6
  //#region src/types/plugin.d.ts
7
7
  type CapnpPluginOptions = Partial<Omit<CapnpcOptions, "workspaceRoot" | "projectRoot" | "schemas">> & {
@@ -1,7 +1,7 @@
1
- import { UserConfig } from "../powerlines/src/types/config.mjs";
2
- import { ResolvedConfig } from "../powerlines/src/types/resolved.mjs";
3
- import { PluginContext } from "../powerlines/src/types/context.mjs";
4
1
  import { CapnpcOptions } from "@stryke/capnp/types";
2
+ import { UserConfig } from "powerlines/types/config";
3
+ import { PluginContext } from "powerlines/types/context";
4
+ import { ResolvedConfig } from "powerlines/types/resolved";
5
5
 
6
6
  //#region src/types/plugin.d.ts
7
7
  type CapnpPluginOptions = Partial<Omit<CapnpcOptions, "workspaceRoot" | "projectRoot" | "schemas">> & {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@powerlines/plugin-capnp",
3
- "version": "0.1.235",
3
+ "version": "0.1.237",
4
4
  "type": "module",
5
5
  "description": "A Powerlines plugin to generate project code from Cap'n Proto schemas.",
6
6
  "repository": {
@@ -41,34 +41,81 @@
41
41
  "main": "./dist/index.cjs",
42
42
  "module": "./dist/index.mjs",
43
43
  "exports": {
44
- ".": { "require": "./dist/index.cjs", "import": "./dist/index.mjs" },
44
+ ".": {
45
+ "require": {
46
+ "types": "./dist/index.d.cts",
47
+ "default": "./dist/index.cjs"
48
+ },
49
+ "import": {
50
+ "types": "./dist/index.d.mts",
51
+ "default": "./dist/index.mjs"
52
+ },
53
+ "default": {
54
+ "types": "./dist/index.d.mts",
55
+ "default": "./dist/index.mjs"
56
+ }
57
+ },
58
+ "./package.json": "./package.json",
45
59
  "./types": {
46
- "require": "./dist/types/index.cjs",
47
- "import": "./dist/types/index.mjs"
60
+ "require": {
61
+ "types": "./dist/types/index.d.cts",
62
+ "default": "./dist/types/index.cjs"
63
+ },
64
+ "import": {
65
+ "types": "./dist/types/index.d.mts",
66
+ "default": "./dist/types/index.mjs"
67
+ },
68
+ "default": {
69
+ "types": "./dist/types/index.d.mts",
70
+ "default": "./dist/types/index.mjs"
71
+ }
48
72
  },
49
- "./types/plugin": {
50
- "require": "./dist/types/plugin.cjs",
51
- "import": "./dist/types/plugin.mjs"
73
+ "./types/*": {
74
+ "require": {
75
+ "types": "./dist/types/*.d.cts",
76
+ "default": "./dist/types/*.cjs"
77
+ },
78
+ "import": {
79
+ "types": "./dist/types/*.d.mts",
80
+ "default": "./dist/types/*.mjs"
81
+ },
82
+ "default": {
83
+ "types": "./dist/types/*.d.mts",
84
+ "default": "./dist/types/*.mjs"
85
+ }
52
86
  },
53
- "./package.json": "./package.json"
87
+ "./types/plugin": {
88
+ "require": {
89
+ "types": "./dist/types/plugin.d.cts",
90
+ "default": "./dist/types/plugin.cjs"
91
+ },
92
+ "import": {
93
+ "types": "./dist/types/plugin.d.mts",
94
+ "default": "./dist/types/plugin.mjs"
95
+ },
96
+ "default": {
97
+ "types": "./dist/types/plugin.d.mts",
98
+ "default": "./dist/types/plugin.mjs"
99
+ }
100
+ }
54
101
  },
55
102
  "typings": "dist/index.d.mts",
56
103
  "files": ["dist/**/*"],
57
104
  "keywords": ["capnp", "powerlines", "storm-software", "powerlines-plugin"],
58
105
  "dependencies": {
59
- "@stryke/capnp": "^0.12.63",
60
- "@stryke/path": "^0.26.2",
106
+ "@stryke/capnp": "^0.12.64",
107
+ "@stryke/path": "^0.26.3",
61
108
  "@stryke/type-checks": "^0.5.22",
62
109
  "@stryke/types": "^0.10.36",
63
110
  "defu": "^6.1.4",
64
111
  "jiti": "^2.6.1",
65
- "powerlines": "^0.38.0"
112
+ "powerlines": "^0.38.1"
66
113
  },
67
114
  "devDependencies": {
68
- "@powerlines/plugin-plugin": "^0.12.183",
115
+ "@powerlines/plugin-plugin": "^0.12.185",
69
116
  "@types/node": "^24.10.9"
70
117
  },
71
118
  "publishConfig": { "access": "public" },
72
119
  "types": "./dist/index.d.cts",
73
- "gitHead": "2b025c75ca3472c6d322f6576f47ed70184abb1f"
120
+ "gitHead": "2a4d9ef63cc29e4551fa9f680ea63874c7f48d2d"
74
121
  }
@@ -1,47 +0,0 @@
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 };
@@ -1,47 +0,0 @@
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 };
@@ -1,36 +0,0 @@
1
- const require_rolldown_runtime = require('../../../_virtual/rolldown_runtime.cjs');
2
- let __stryke_path_replace = require("@stryke/path/replace");
3
-
4
- //#region ../powerlines/src/plugin-utils/paths.ts
5
- /**
6
- * Replaces tokens in the given path string with their corresponding values from the context.
7
- *
8
- * @remarks
9
- * The following tokens are supported:
10
- * - `{workspaceRoot}` - The root directory of the workspace.
11
- * - `{root}` - The root directory of the project (same as `{projectRoot}`).
12
- * - `{projectRoot}` - The root directory of the project (same as `{root}`).
13
- * - `{sourceRoot}` - The source root directory of the project (usually `./src`).
14
- * - `{powerlinesPath}` - The directory where Powerlines is installed.
15
- * - `{cachePath}` - The environment's directory for cached files.
16
- * - `{dataPath}` - The environment's directory for data files.
17
- * - `{logPath}` - The environment's directory for log files.
18
- * - `{tempPath}` - The environment's directory for temporary files.
19
- * - `{configPath}` - The environment's directory for configuration files.
20
- * - `{outputPath}` - The configured output directory for the project.
21
- * - `{buildPath}` - The configured distribution directory for the project.
22
- * - `{artifactsPath}` - The configured directory for build artifacts.
23
- * - `{builtinPath}` - The configured directory for generated built-in plugins.
24
- * - `{entryPath}` - The configured directory for generated entry files.
25
- *
26
- * @param context - The context containing the values for the path tokens.
27
- * @param path - The path string with tokens to replace.
28
- * @returns The path string with tokens replaced by their corresponding values from the context.
29
- */
30
- function replacePathTokens(context, path) {
31
- if (!path) return path;
32
- return path.replaceAll("{workspaceRoot}", context.workspaceConfig.workspaceRoot).replaceAll("{root}", context.config.projectRoot).replaceAll("{projectRoot}", context.config.projectRoot).replaceAll("{sourceRoot}", context.config.sourceRoot).replaceAll("{powerlinesPath}", context.powerlinesPath).replaceAll("{cachePath}", context.cachePath).replaceAll("{dataPath}", context.dataPath).replaceAll("{logPath}", context.envPaths.log).replaceAll("{tempPath}", context.envPaths.temp).replaceAll("{configPath}", context.envPaths.config).replaceAll("{outputPath}", context.config.output.outputPath).replaceAll("{buildPath}", context.config.output.buildPath).replaceAll("{artifactsPath}", (0, __stryke_path_replace.replacePath)(context.artifactsPath, context.workspaceConfig.workspaceRoot)).replaceAll("{builtinPath}", (0, __stryke_path_replace.replacePath)(context.builtinsPath, context.workspaceConfig.workspaceRoot)).replaceAll("{entryPath}", (0, __stryke_path_replace.replacePath)(context.entryPath, context.workspaceConfig.workspaceRoot));
33
- }
34
-
35
- //#endregion
36
- exports.replacePathTokens = replacePathTokens;
@@ -1,35 +0,0 @@
1
- import { replacePath } from "@stryke/path/replace";
2
-
3
- //#region ../powerlines/src/plugin-utils/paths.ts
4
- /**
5
- * Replaces tokens in the given path string with their corresponding values from the context.
6
- *
7
- * @remarks
8
- * The following tokens are supported:
9
- * - `{workspaceRoot}` - The root directory of the workspace.
10
- * - `{root}` - The root directory of the project (same as `{projectRoot}`).
11
- * - `{projectRoot}` - The root directory of the project (same as `{root}`).
12
- * - `{sourceRoot}` - The source root directory of the project (usually `./src`).
13
- * - `{powerlinesPath}` - The directory where Powerlines is installed.
14
- * - `{cachePath}` - The environment's directory for cached files.
15
- * - `{dataPath}` - The environment's directory for data files.
16
- * - `{logPath}` - The environment's directory for log files.
17
- * - `{tempPath}` - The environment's directory for temporary files.
18
- * - `{configPath}` - The environment's directory for configuration files.
19
- * - `{outputPath}` - The configured output directory for the project.
20
- * - `{buildPath}` - The configured distribution directory for the project.
21
- * - `{artifactsPath}` - The configured directory for build artifacts.
22
- * - `{builtinPath}` - The configured directory for generated built-in plugins.
23
- * - `{entryPath}` - The configured directory for generated entry files.
24
- *
25
- * @param context - The context containing the values for the path tokens.
26
- * @param path - The path string with tokens to replace.
27
- * @returns The path string with tokens replaced by their corresponding values from the context.
28
- */
29
- function replacePathTokens(context, path) {
30
- if (!path) return path;
31
- return path.replaceAll("{workspaceRoot}", context.workspaceConfig.workspaceRoot).replaceAll("{root}", context.config.projectRoot).replaceAll("{projectRoot}", context.config.projectRoot).replaceAll("{sourceRoot}", context.config.sourceRoot).replaceAll("{powerlinesPath}", context.powerlinesPath).replaceAll("{cachePath}", context.cachePath).replaceAll("{dataPath}", context.dataPath).replaceAll("{logPath}", context.envPaths.log).replaceAll("{tempPath}", context.envPaths.temp).replaceAll("{configPath}", context.envPaths.config).replaceAll("{outputPath}", context.config.output.outputPath).replaceAll("{buildPath}", context.config.output.buildPath).replaceAll("{artifactsPath}", replacePath(context.artifactsPath, context.workspaceConfig.workspaceRoot)).replaceAll("{builtinPath}", replacePath(context.builtinsPath, context.workspaceConfig.workspaceRoot)).replaceAll("{entryPath}", replacePath(context.entryPath, context.workspaceConfig.workspaceRoot));
32
- }
33
-
34
- //#endregion
35
- export { replacePathTokens };
@@ -1,104 +0,0 @@
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 };
@@ -1,104 +0,0 @@
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 };