@powerlines/plugin-openapi 0.2.133 → 0.2.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,11 +1,11 @@
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_path_join_paths = require("@stryke/path/join-paths");
5
4
  let defu = require("defu");
6
5
  defu = require_rolldown_runtime.__toESM(defu);
7
6
  let openapi_typescript = require("openapi-typescript");
8
7
  openapi_typescript = require_rolldown_runtime.__toESM(openapi_typescript);
8
+ let powerlines_plugin_utils_paths = require("powerlines/plugin-utils/paths");
9
9
 
10
10
  //#region src/index.ts
11
11
  /**
@@ -26,7 +26,7 @@ const plugin = (options = {}) => {
26
26
  }) };
27
27
  },
28
28
  async configResolved() {
29
- this.config.openapi.outputPath = require_paths.replacePathTokens(this, this.config.openapi.outputPath);
29
+ this.config.openapi.outputPath = (0, powerlines_plugin_utils_paths.replacePathTokens)(this, this.config.openapi.outputPath);
30
30
  },
31
31
  async prepare() {
32
32
  const ast = await (0, openapi_typescript.default)(this.config.openapi.schema, this.config.openapi);
package/dist/index.mjs CHANGED
@@ -1,7 +1,7 @@
1
- import { replacePathTokens } from "./powerlines/src/plugin-utils/paths.mjs";
2
1
  import { joinPaths } from "@stryke/path/join-paths";
3
2
  import defu from "defu";
4
3
  import openapiTS, { astToString } from "openapi-typescript";
4
+ import { replacePathTokens } from "powerlines/plugin-utils/paths";
5
5
 
6
6
  //#region src/index.ts
7
7
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@powerlines/plugin-openapi",
3
- "version": "0.2.133",
3
+ "version": "0.2.134",
4
4
  "type": "module",
5
5
  "description": "A Powerlines plugin to generate project code from OpenAPI specifications.",
6
6
  "repository": {
@@ -129,13 +129,12 @@
129
129
  "defu": "^6.1.4",
130
130
  "jiti": "^2.6.1",
131
131
  "openapi-typescript": "^7.10.1",
132
- "powerlines": "^0.37.2"
132
+ "powerlines": "^0.37.3"
133
133
  },
134
134
  "devDependencies": {
135
- "@powerlines/nx": "^0.11.58",
136
- "@powerlines/plugin-plugin": "^0.12.80",
135
+ "@powerlines/plugin-plugin": "^0.12.81",
137
136
  "@types/node": "^24.10.4"
138
137
  },
139
138
  "publishConfig": { "access": "public" },
140
- "gitHead": "5a9bfc9333eca98a453682f39a04a0d642930a50"
139
+ "gitHead": "ae9a5afaa497538477b63988242f433b60974623"
141
140
  }
@@ -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 };