@powerlines/plugin-asyncapi 0.1.125 → 0.1.126
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-BgAdqTbb.d.mts +1 -0
- package/dist/index-CEgs-Dz2.d.cts +1 -0
- package/dist/index.cjs +64 -4
- package/dist/index.d.cts +2 -2
- package/dist/index.d.mts +2 -3
- package/dist/index.mjs +35 -1
- package/dist/plugin-C3MaN5jp.mjs +1 -0
- package/dist/plugin-Cesl-g7l.d.mts +1845 -0
- package/dist/plugin-DHXHjv16.cjs +0 -0
- package/dist/plugin-DriZVY5K.d.cts +1845 -0
- package/dist/types/index.cjs +2 -0
- package/dist/types/index.d.cts +2 -1
- package/dist/types/index.d.mts +2 -1
- package/dist/types/index.mjs +3 -0
- package/dist/types/plugin.cjs +1 -0
- package/dist/types/plugin.d.cts +1 -100
- package/dist/types/plugin.d.mts +1 -100
- package/dist/types/plugin.mjs +2 -0
- package/dist/types-CTUnla4x.mjs +1 -0
- package/dist/types-DHkg7xmX.cjs +0 -0
- package/package.json +3 -3
- package/dist/_virtual/rolldown_runtime.cjs +0 -29
- 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/build.d.cts +0 -145
- package/dist/powerlines/src/types/build.d.mts +0 -145
- 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 -369
- package/dist/powerlines/src/types/config.d.mts +0 -369
- package/dist/powerlines/src/types/context.d.cts +0 -403
- package/dist/powerlines/src/types/context.d.mts +0 -403
- 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/plugin.d.cts +0 -231
- package/dist/powerlines/src/types/plugin.d.mts +0 -231
- package/dist/powerlines/src/types/resolved.d.cts +0 -81
- package/dist/powerlines/src/types/resolved.d.mts +0 -81
- package/dist/powerlines/src/types/tsconfig.d.cts +0 -69
- package/dist/powerlines/src/types/tsconfig.d.mts +0 -69
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { };
|
package/dist/index.cjs
CHANGED
|
@@ -1,14 +1,74 @@
|
|
|
1
1
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
2
|
-
|
|
3
|
-
|
|
2
|
+
//#region rolldown:runtime
|
|
3
|
+
var __create = Object.create;
|
|
4
|
+
var __defProp = Object.defineProperty;
|
|
5
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
6
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
7
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
8
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
9
|
+
var __copyProps = (to, from, except, desc) => {
|
|
10
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
|
+
for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
|
|
12
|
+
key = keys[i];
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except) {
|
|
14
|
+
__defProp(to, key, {
|
|
15
|
+
get: ((k) => from[k]).bind(null, key),
|
|
16
|
+
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
17
|
+
});
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
return to;
|
|
22
|
+
};
|
|
23
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
|
|
24
|
+
value: mod,
|
|
25
|
+
enumerable: true
|
|
26
|
+
}) : target, mod));
|
|
27
|
+
|
|
28
|
+
//#endregion
|
|
29
|
+
require('./plugin-DHXHjv16.cjs');
|
|
30
|
+
require('./types-DHkg7xmX.cjs');
|
|
4
31
|
let __asyncapi_generator = require("@asyncapi/generator");
|
|
5
32
|
let __asyncapi_parser_esm_document = require("@asyncapi/parser/esm/document");
|
|
6
33
|
let __stryke_fs_exists = require("@stryke/fs/exists");
|
|
7
34
|
let __stryke_fs_package_fns = require("@stryke/fs/package-fns");
|
|
8
35
|
let __stryke_path_join = require("@stryke/path/join");
|
|
9
36
|
let defu = require("defu");
|
|
10
|
-
defu =
|
|
37
|
+
defu = __toESM(defu);
|
|
38
|
+
let __stryke_path_replace = require("@stryke/path/replace");
|
|
11
39
|
|
|
40
|
+
//#region ../powerlines/src/plugin-utils/paths.ts
|
|
41
|
+
/**
|
|
42
|
+
* Replaces tokens in the given path string with their corresponding values from the context.
|
|
43
|
+
*
|
|
44
|
+
* @remarks
|
|
45
|
+
* The following tokens are supported:
|
|
46
|
+
* - `{workspaceRoot}` - The root directory of the workspace.
|
|
47
|
+
* - `{root}` - The root directory of the project (same as `{projectRoot}`).
|
|
48
|
+
* - `{projectRoot}` - The root directory of the project (same as `{root}`).
|
|
49
|
+
* - `{sourceRoot}` - The source root directory of the project (usually `./src`).
|
|
50
|
+
* - `{powerlinesPath}` - The directory where Powerlines is installed.
|
|
51
|
+
* - `{cachePath}` - The environment's directory for cached files.
|
|
52
|
+
* - `{dataPath}` - The environment's directory for data files.
|
|
53
|
+
* - `{logPath}` - The environment's directory for log files.
|
|
54
|
+
* - `{tempPath}` - The environment's directory for temporary files.
|
|
55
|
+
* - `{configPath}` - The environment's directory for configuration files.
|
|
56
|
+
* - `{outputPath}` - The configured output directory for the project.
|
|
57
|
+
* - `{buildPath}` - The configured distribution directory for the project.
|
|
58
|
+
* - `{artifactsPath}` - The configured directory for build artifacts.
|
|
59
|
+
* - `{builtinPath}` - The configured directory for generated built-in plugins.
|
|
60
|
+
* - `{entryPath}` - The configured directory for generated entry files.
|
|
61
|
+
*
|
|
62
|
+
* @param context - The context containing the values for the path tokens.
|
|
63
|
+
* @param path - The path string with tokens to replace.
|
|
64
|
+
* @returns The path string with tokens replaced by their corresponding values from the context.
|
|
65
|
+
*/
|
|
66
|
+
function replacePathTokens(context, path) {
|
|
67
|
+
if (!path) return path;
|
|
68
|
+
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));
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
//#endregion
|
|
12
72
|
//#region src/index.ts
|
|
13
73
|
/**
|
|
14
74
|
* A Powerlines plugin to integrate AsyncAPI for code generation.
|
|
@@ -44,7 +104,7 @@ const plugin = (options) => {
|
|
|
44
104
|
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
105
|
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
106
|
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 =
|
|
107
|
+
this.config.asyncapi.outputPath = replacePathTokens(this, this.config.asyncapi.outputPath);
|
|
48
108
|
},
|
|
49
109
|
async prepare() {
|
|
50
110
|
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,5 @@
|
|
|
1
|
-
import { Plugin } from "./
|
|
2
|
-
import
|
|
1
|
+
import { a as __ΩAsyncAPIPluginContext, c as __ΩAsyncAPIPluginUserConfig, i as AsyncAPIPluginUserConfig, l as Plugin, n as AsyncAPIPluginOptions, o as __ΩAsyncAPIPluginOptions, r as AsyncAPIPluginResolvedConfig, s as __ΩAsyncAPIPluginResolvedConfig, t as AsyncAPIPluginContext } from "./plugin-DriZVY5K.cjs";
|
|
2
|
+
import "./index-CEgs-Dz2.cjs";
|
|
3
3
|
|
|
4
4
|
//#region src/index.d.ts
|
|
5
5
|
|
package/dist/index.d.mts
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import { Plugin } from "./
|
|
2
|
-
import
|
|
3
|
-
import "./types/index.mjs";
|
|
1
|
+
import { a as __ΩAsyncAPIPluginContext, c as __ΩAsyncAPIPluginUserConfig, i as AsyncAPIPluginUserConfig, l as Plugin, n as AsyncAPIPluginOptions, o as __ΩAsyncAPIPluginOptions, r as AsyncAPIPluginResolvedConfig, s as __ΩAsyncAPIPluginResolvedConfig, t as AsyncAPIPluginContext } from "./plugin-Cesl-g7l.mjs";
|
|
2
|
+
import "./index-BgAdqTbb.mjs";
|
|
4
3
|
|
|
5
4
|
//#region src/index.d.ts
|
|
6
5
|
|
package/dist/index.mjs
CHANGED
|
@@ -1,11 +1,45 @@
|
|
|
1
|
-
import
|
|
1
|
+
import "./plugin-C3MaN5jp.mjs";
|
|
2
|
+
import "./types-CTUnla4x.mjs";
|
|
2
3
|
import { Generator } from "@asyncapi/generator";
|
|
3
4
|
import { isAsyncAPIDocument } from "@asyncapi/parser/esm/document";
|
|
4
5
|
import { existsSync } from "@stryke/fs/exists";
|
|
5
6
|
import { isPackageExists } from "@stryke/fs/package-fns";
|
|
6
7
|
import { joinPaths } from "@stryke/path/join";
|
|
7
8
|
import defu from "defu";
|
|
9
|
+
import { replacePath } from "@stryke/path/replace";
|
|
8
10
|
|
|
11
|
+
//#region ../powerlines/src/plugin-utils/paths.ts
|
|
12
|
+
/**
|
|
13
|
+
* Replaces tokens in the given path string with their corresponding values from the context.
|
|
14
|
+
*
|
|
15
|
+
* @remarks
|
|
16
|
+
* The following tokens are supported:
|
|
17
|
+
* - `{workspaceRoot}` - The root directory of the workspace.
|
|
18
|
+
* - `{root}` - The root directory of the project (same as `{projectRoot}`).
|
|
19
|
+
* - `{projectRoot}` - The root directory of the project (same as `{root}`).
|
|
20
|
+
* - `{sourceRoot}` - The source root directory of the project (usually `./src`).
|
|
21
|
+
* - `{powerlinesPath}` - The directory where Powerlines is installed.
|
|
22
|
+
* - `{cachePath}` - The environment's directory for cached files.
|
|
23
|
+
* - `{dataPath}` - The environment's directory for data files.
|
|
24
|
+
* - `{logPath}` - The environment's directory for log files.
|
|
25
|
+
* - `{tempPath}` - The environment's directory for temporary files.
|
|
26
|
+
* - `{configPath}` - The environment's directory for configuration files.
|
|
27
|
+
* - `{outputPath}` - The configured output directory for the project.
|
|
28
|
+
* - `{buildPath}` - The configured distribution directory for the project.
|
|
29
|
+
* - `{artifactsPath}` - The configured directory for build artifacts.
|
|
30
|
+
* - `{builtinPath}` - The configured directory for generated built-in plugins.
|
|
31
|
+
* - `{entryPath}` - The configured directory for generated entry files.
|
|
32
|
+
*
|
|
33
|
+
* @param context - The context containing the values for the path tokens.
|
|
34
|
+
* @param path - The path string with tokens to replace.
|
|
35
|
+
* @returns The path string with tokens replaced by their corresponding values from the context.
|
|
36
|
+
*/
|
|
37
|
+
function replacePathTokens(context, path) {
|
|
38
|
+
if (!path) return path;
|
|
39
|
+
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));
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
//#endregion
|
|
9
43
|
//#region src/index.ts
|
|
10
44
|
/**
|
|
11
45
|
* A Powerlines plugin to integrate AsyncAPI for code generation.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { };
|