@powerlines/plugin-asyncapi 0.1.227 → 0.1.228
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/index.cjs +2 -2
- package/dist/index.d.cts +2 -1
- package/dist/index.d.mts +1 -1
- package/dist/index.mjs +1 -1
- package/dist/types/plugin.d.cts +3 -3
- package/dist/types/plugin.d.mts +3 -3
- package/package.json +3 -3
- package/dist/powerlines/src/internal/helpers/hooks.d.cts +0 -47
- package/dist/powerlines/src/internal/helpers/hooks.d.mts +0 -47
- package/dist/powerlines/src/plugin-utils/paths.cjs +0 -36
- package/dist/powerlines/src/plugin-utils/paths.mjs +0 -35
- package/dist/powerlines/src/types/api.d.cts +0 -104
- package/dist/powerlines/src/types/api.d.mts +0 -104
- package/dist/powerlines/src/types/build.d.cts +0 -185
- package/dist/powerlines/src/types/build.d.mts +0 -185
- package/dist/powerlines/src/types/commands.d.cts +0 -8
- package/dist/powerlines/src/types/commands.d.mts +0 -8
- package/dist/powerlines/src/types/config.d.cts +0 -424
- package/dist/powerlines/src/types/config.d.mts +0 -424
- package/dist/powerlines/src/types/context.d.cts +0 -514
- package/dist/powerlines/src/types/context.d.mts +0 -514
- package/dist/powerlines/src/types/fs.d.cts +0 -486
- package/dist/powerlines/src/types/fs.d.mts +0 -486
- package/dist/powerlines/src/types/hooks.d.cts +0 -32
- package/dist/powerlines/src/types/hooks.d.mts +0 -32
- package/dist/powerlines/src/types/plugin.d.cts +0 -205
- package/dist/powerlines/src/types/plugin.d.mts +0 -205
- package/dist/powerlines/src/types/resolved.d.cts +0 -93
- package/dist/powerlines/src/types/resolved.d.mts +0 -93
- package/dist/powerlines/src/types/tsconfig.d.cts +0 -69
- package/dist/powerlines/src/types/tsconfig.d.mts +0 -69
- package/dist/powerlines/src/types/unplugin.d.cts +0 -22
- 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 __asyncapi_generator = require("@asyncapi/generator");
|
|
5
4
|
let __asyncapi_parser_esm_document = require("@asyncapi/parser/esm/document");
|
|
6
5
|
let __stryke_fs_exists = require("@stryke/fs/exists");
|
|
@@ -8,6 +7,7 @@ let __stryke_fs_package_fns = require("@stryke/fs/package-fns");
|
|
|
8
7
|
let __stryke_path_join = require("@stryke/path/join");
|
|
9
8
|
let defu = require("defu");
|
|
10
9
|
defu = require_rolldown_runtime.__toESM(defu);
|
|
10
|
+
let powerlines_plugin_utils_paths = require("powerlines/plugin-utils/paths");
|
|
11
11
|
|
|
12
12
|
//#region src/index.ts
|
|
13
13
|
/**
|
|
@@ -44,7 +44,7 @@ const plugin = (options) => {
|
|
|
44
44
|
if (!this.config.asyncapi.templateName) throw new Error("AsyncAPI template name is required. Please specify it in the plugin options or your Powerlines configuration under \"asyncapi.templateName\".");
|
|
45
45
|
if (!this.config.asyncapi.outputPath) throw new Error("AsyncAPI output path is required. Please specify it in the plugin options or your Powerlines configuration under \"asyncapi.outputPath\".");
|
|
46
46
|
if (!(0, __stryke_fs_exists.existsSync)(this.config.asyncapi.templateName) && !(0, __stryke_fs_package_fns.isPackageExists)(this.config.asyncapi.templateName)) this.devDependencies[this.config.asyncapi.templateName] = "latest";
|
|
47
|
-
this.config.asyncapi.outputPath =
|
|
47
|
+
this.config.asyncapi.outputPath = (0, powerlines_plugin_utils_paths.replacePathTokens)(this, this.config.asyncapi.outputPath);
|
|
48
48
|
},
|
|
49
49
|
async prepare() {
|
|
50
50
|
await new __asyncapi_generator.Generator(this.config.asyncapi.templateName, this.config.asyncapi.outputPath, this.config.asyncapi).generate(this.config.asyncapi.document);
|
package/dist/index.d.cts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import { Plugin } from "./powerlines/src/types/plugin.cjs";
|
|
2
1
|
import { AsyncAPIPluginContext, AsyncAPIPluginOptions, AsyncAPIPluginResolvedConfig, AsyncAPIPluginUserConfig, __ΩAsyncAPIPluginContext, __ΩAsyncAPIPluginOptions, __ΩAsyncAPIPluginResolvedConfig, __ΩAsyncAPIPluginUserConfig } 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,6 +1,6 @@
|
|
|
1
|
-
import { Plugin } from "./powerlines/src/types/plugin.mjs";
|
|
2
1
|
import { AsyncAPIPluginContext, AsyncAPIPluginOptions, AsyncAPIPluginResolvedConfig, AsyncAPIPluginUserConfig, __ΩAsyncAPIPluginContext, __ΩAsyncAPIPluginOptions, __ΩAsyncAPIPluginResolvedConfig, __ΩAsyncAPIPluginUserConfig } from "./types/plugin.mjs";
|
|
3
2
|
import "./types/index.mjs";
|
|
3
|
+
import { Plugin } from "powerlines/types/plugin";
|
|
4
4
|
|
|
5
5
|
//#region src/index.d.ts
|
|
6
6
|
|
package/dist/index.mjs
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { replacePathTokens } from "./powerlines/src/plugin-utils/paths.mjs";
|
|
2
1
|
import { Generator } from "@asyncapi/generator";
|
|
3
2
|
import { isAsyncAPIDocument } from "@asyncapi/parser/esm/document";
|
|
4
3
|
import { existsSync } from "@stryke/fs/exists";
|
|
5
4
|
import { isPackageExists } from "@stryke/fs/package-fns";
|
|
6
5
|
import { joinPaths } from "@stryke/path/join";
|
|
7
6
|
import defu from "defu";
|
|
7
|
+
import { replacePathTokens } from "powerlines/plugin-utils/paths";
|
|
8
8
|
|
|
9
9
|
//#region src/index.ts
|
|
10
10
|
/**
|
package/dist/types/plugin.d.cts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
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 { GeneratorOptions } from "@asyncapi/generator";
|
|
5
2
|
import { AsyncAPIDocument } from "@asyncapi/parser/esm/models/v3/asyncapi";
|
|
3
|
+
import { UserConfig } from "powerlines/types/config";
|
|
4
|
+
import { PluginContext } from "powerlines/types/context";
|
|
5
|
+
import { ResolvedConfig } from "powerlines/types/resolved";
|
|
6
6
|
|
|
7
7
|
//#region src/types/plugin.d.ts
|
|
8
8
|
interface AsyncAPIPluginOptions {
|
package/dist/types/plugin.d.mts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
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 { GeneratorOptions } from "@asyncapi/generator";
|
|
5
2
|
import { AsyncAPIDocument } from "@asyncapi/parser/esm/models/v3/asyncapi";
|
|
3
|
+
import { UserConfig } from "powerlines/types/config";
|
|
4
|
+
import { PluginContext } from "powerlines/types/context";
|
|
5
|
+
import { ResolvedConfig } from "powerlines/types/resolved";
|
|
6
6
|
|
|
7
7
|
//#region src/types/plugin.d.ts
|
|
8
8
|
interface AsyncAPIPluginOptions {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@powerlines/plugin-asyncapi",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.228",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "A Powerlines plugin to generate project code from AsyncAPI specifications.",
|
|
6
6
|
"repository": {
|
|
@@ -127,9 +127,9 @@
|
|
|
127
127
|
"powerlines": "^0.37.95"
|
|
128
128
|
},
|
|
129
129
|
"devDependencies": {
|
|
130
|
-
"@powerlines/plugin-plugin": "^0.12.
|
|
130
|
+
"@powerlines/plugin-plugin": "^0.12.175",
|
|
131
131
|
"@types/node": "^24.10.9"
|
|
132
132
|
},
|
|
133
133
|
"publishConfig": { "access": "public" },
|
|
134
|
-
"gitHead": "
|
|
134
|
+
"gitHead": "f153baa7a374fe331eeb1b8ea37c30c379c5efce"
|
|
135
135
|
}
|
|
@@ -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 };
|