@powerlines/plugin-asyncapi 0.1.132 → 0.1.134

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 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 = require_paths.replacePathTokens(this, 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.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@powerlines/plugin-asyncapi",
3
- "version": "0.1.132",
3
+ "version": "0.1.134",
4
4
  "type": "module",
5
5
  "description": "A Powerlines plugin to generate project code from AsyncAPI specifications.",
6
6
  "repository": {
@@ -124,13 +124,12 @@
124
124
  "@stryke/http": "^0.12.21",
125
125
  "@stryke/path": "^0.24.1",
126
126
  "defu": "^6.1.4",
127
- "powerlines": "^0.37.2"
127
+ "powerlines": "^0.37.4"
128
128
  },
129
129
  "devDependencies": {
130
- "@powerlines/nx": "^0.11.58",
131
- "@powerlines/plugin-plugin": "^0.12.80",
130
+ "@powerlines/plugin-plugin": "^0.12.82",
132
131
  "@types/node": "^24.10.4"
133
132
  },
134
133
  "publishConfig": { "access": "public" },
135
- "gitHead": "5a9bfc9333eca98a453682f39a04a0d642930a50"
134
+ "gitHead": "48a35579bd5535a267a420c160c273899920b2e7"
136
135
  }
@@ -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 };