@powerlines/plugin-openapi 0.2.461 → 0.2.463

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.
@@ -1 +1,29 @@
1
- var e=Object.create,t=Object.defineProperty,n=Object.getOwnPropertyDescriptor,r=Object.getOwnPropertyNames,i=Object.getPrototypeOf,a=Object.prototype.hasOwnProperty,o=(e,i,o,s)=>{if(i&&typeof i==`object`||typeof i==`function`)for(var c=r(i),l=0,u=c.length,d;l<u;l++)d=c[l],!a.call(e,d)&&d!==o&&t(e,d,{get:(e=>i[e]).bind(null,d),enumerable:!(s=n(i,d))||s.enumerable});return e},s=(n,r,a)=>(a=n==null?{}:e(i(n)),o(r||!n||!n.__esModule?t(a,`default`,{value:n,enumerable:!0}):a,n));exports.__toESM=s;
1
+ //#region \0rolldown/runtime.js
2
+ var __create = Object.create;
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __getProtoOf = Object.getPrototypeOf;
7
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
8
+ var __copyProps = (to, from, except, desc) => {
9
+ if (from && typeof from === "object" || typeof from === "function") {
10
+ for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
11
+ key = keys[i];
12
+ if (!__hasOwnProp.call(to, key) && key !== except) {
13
+ __defProp(to, key, {
14
+ get: ((k) => from[k]).bind(null, key),
15
+ enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
16
+ });
17
+ }
18
+ }
19
+ }
20
+ return to;
21
+ };
22
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
23
+ value: mod,
24
+ enumerable: true
25
+ }) : target, mod));
26
+
27
+ //#endregion
28
+
29
+ exports.__toESM = __toESM;
package/dist/index.cjs CHANGED
@@ -1 +1,41 @@
1
- Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:`Module`}});const e=require(`./_virtual/_rolldown/runtime.cjs`);let t=require(`@stryke/path/join-paths`),n=require(`defu`);n=e.__toESM(n,1);let r=require(`openapi-typescript`);r=e.__toESM(r,1);let i=require(`powerlines/plugin-utils`);const a=(e={})=>({name:`openapi`,config(){return{openapi:(0,n.default)(e,{schema:(0,t.joinPaths)(this.config.cwd,this.config.root,`schema.yaml`),cwd:(0,t.joinPaths)(this.config.cwd,this.config.root),outputPath:(0,t.joinPaths)(`{builtinPath}`,`api`),silent:this.config.logLevel===null})}},async configResolved(){this.config.openapi.outputPath=(0,i.replacePathTokens)(this,this.config.openapi.outputPath)},async prepare(){let e=await(0,r.default)(this.config.openapi.schema,this.config.openapi);this.config.openapi.outputPath?await this.fs.write(this.config.openapi.outputPath,(0,r.astToString)(e,{fileName:this.config.openapi.outputPath})):await this.emitBuiltin((0,r.astToString)(e),`openapi`)}});exports.default=a,exports.plugin=a;
1
+ Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: 'Module' } });
2
+ const require_runtime = require('./_virtual/_rolldown/runtime.cjs');
3
+ let _stryke_path_join_paths = require("@stryke/path/join-paths");
4
+ let defu = require("defu");
5
+ defu = require_runtime.__toESM(defu, 1);
6
+ let openapi_typescript = require("openapi-typescript");
7
+ openapi_typescript = require_runtime.__toESM(openapi_typescript, 1);
8
+ let powerlines_plugin_utils = require("powerlines/plugin-utils");
9
+
10
+ //#region src/index.ts
11
+ /**
12
+ * A Powerlines plugin to integrate OpenAPI for code generation.
13
+ *
14
+ * @param options - The plugin options.
15
+ * @returns A Powerlines plugin instance.
16
+ */
17
+ const plugin = (options = {}) => {
18
+ return {
19
+ name: "openapi",
20
+ config() {
21
+ return { openapi: (0, defu.default)(options, {
22
+ schema: (0, _stryke_path_join_paths.joinPaths)(this.config.cwd, this.config.root, "schema.yaml"),
23
+ cwd: (0, _stryke_path_join_paths.joinPaths)(this.config.cwd, this.config.root),
24
+ outputPath: (0, _stryke_path_join_paths.joinPaths)("{builtinPath}", "api"),
25
+ silent: this.config.logLevel === null
26
+ }) };
27
+ },
28
+ async configResolved() {
29
+ this.config.openapi.outputPath = (0, powerlines_plugin_utils.replacePathTokens)(this, this.config.openapi.outputPath);
30
+ },
31
+ async prepare() {
32
+ const ast = await (0, openapi_typescript.default)(this.config.openapi.schema, this.config.openapi);
33
+ if (this.config.openapi.outputPath) await this.fs.write(this.config.openapi.outputPath, (0, openapi_typescript.astToString)(ast, { fileName: this.config.openapi.outputPath }));
34
+ else await this.emitBuiltin((0, openapi_typescript.astToString)(ast), "openapi");
35
+ }
36
+ };
37
+ };
38
+
39
+ //#endregion
40
+ exports.default = plugin;
41
+ exports.plugin = plugin;
package/dist/index.mjs CHANGED
@@ -1,2 +1,37 @@
1
- import{joinPaths as e}from"@stryke/path/join-paths";import t from"defu";import n,{astToString as r}from"openapi-typescript";import{replacePathTokens as i}from"powerlines/plugin-utils";const a=(a={})=>({name:`openapi`,config(){return{openapi:t(a,{schema:e(this.config.cwd,this.config.root,`schema.yaml`),cwd:e(this.config.cwd,this.config.root),outputPath:e(`{builtinPath}`,`api`),silent:this.config.logLevel===null})}},async configResolved(){this.config.openapi.outputPath=i(this,this.config.openapi.outputPath)},async prepare(){let e=await n(this.config.openapi.schema,this.config.openapi);this.config.openapi.outputPath?await this.fs.write(this.config.openapi.outputPath,r(e,{fileName:this.config.openapi.outputPath})):await this.emitBuiltin(r(e),`openapi`)}});export{a as default,a as plugin};
1
+ import { joinPaths } from "@stryke/path/join-paths";
2
+ import defu from "defu";
3
+ import openapiTS, { astToString } from "openapi-typescript";
4
+ import { replacePathTokens } from "powerlines/plugin-utils";
5
+
6
+ //#region src/index.ts
7
+ /**
8
+ * A Powerlines plugin to integrate OpenAPI for code generation.
9
+ *
10
+ * @param options - The plugin options.
11
+ * @returns A Powerlines plugin instance.
12
+ */
13
+ const plugin = (options = {}) => {
14
+ return {
15
+ name: "openapi",
16
+ config() {
17
+ return { openapi: defu(options, {
18
+ schema: joinPaths(this.config.cwd, this.config.root, "schema.yaml"),
19
+ cwd: joinPaths(this.config.cwd, this.config.root),
20
+ outputPath: joinPaths("{builtinPath}", "api"),
21
+ silent: this.config.logLevel === null
22
+ }) };
23
+ },
24
+ async configResolved() {
25
+ this.config.openapi.outputPath = replacePathTokens(this, this.config.openapi.outputPath);
26
+ },
27
+ async prepare() {
28
+ const ast = await openapiTS(this.config.openapi.schema, this.config.openapi);
29
+ if (this.config.openapi.outputPath) await this.fs.write(this.config.openapi.outputPath, astToString(ast, { fileName: this.config.openapi.outputPath }));
30
+ else await this.emitBuiltin(astToString(ast), "openapi");
31
+ }
32
+ };
33
+ };
34
+
35
+ //#endregion
36
+ export { plugin as default, plugin };
2
37
  //# sourceMappingURL=index.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.mjs","names":[],"sources":["../src/index.ts"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Powerlines\n\n This code was released as part of the Powerlines project. Powerlines\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/powerlines.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/powerlines\n Documentation: https://docs.stormsoftware.com/projects/powerlines\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport { joinPaths } from \"@stryke/path/join-paths\";\nimport defu from \"defu\";\nimport openapiTS, { astToString } from \"openapi-typescript\";\nimport { Plugin } from \"powerlines\";\nimport { replacePathTokens } from \"powerlines/plugin-utils\";\nimport { OpenAPIPluginContext, OpenAPIPluginOptions } from \"./types/plugin\";\n\nexport * from \"./types\";\n\ndeclare module \"powerlines\" {\n interface Config {\n openapi?: OpenAPIPluginOptions;\n }\n}\n\n/**\n * A Powerlines plugin to integrate OpenAPI for code generation.\n *\n * @param options - The plugin options.\n * @returns A Powerlines plugin instance.\n */\nexport const plugin = <\n TContext extends OpenAPIPluginContext = OpenAPIPluginContext\n>(\n options: OpenAPIPluginOptions = {}\n): Plugin<TContext> => {\n return {\n name: \"openapi\",\n config() {\n return {\n openapi: defu(options, {\n schema: joinPaths(this.config.cwd, this.config.root, \"schema.yaml\"),\n cwd: joinPaths(this.config.cwd, this.config.root),\n outputPath: joinPaths(\"{builtinPath}\", \"api\"),\n silent: this.config.logLevel === null\n })\n };\n },\n async configResolved() {\n this.config.openapi.outputPath = replacePathTokens(\n this,\n this.config.openapi.outputPath\n );\n },\n async prepare() {\n const ast = await openapiTS(\n this.config.openapi.schema,\n this.config.openapi\n );\n\n if (this.config.openapi.outputPath) {\n await this.fs.write(\n this.config.openapi.outputPath,\n astToString(ast, {\n fileName: this.config.openapi.outputPath\n })\n );\n } else {\n await this.emitBuiltin(astToString(ast), \"openapi\");\n }\n }\n };\n};\n\nexport default plugin;\n"],"mappings":"wLAuCA,MAAa,GAGX,EAAgC,EAAE,IAE3B,CACL,KAAM,UACN,QAAS,CACP,MAAO,CACL,QAAS,EAAK,EAAS,CACrB,OAAQ,EAAU,KAAK,OAAO,IAAK,KAAK,OAAO,KAAM,cAAc,CACnE,IAAK,EAAU,KAAK,OAAO,IAAK,KAAK,OAAO,KAAK,CACjD,WAAY,EAAU,gBAAiB,MAAM,CAC7C,OAAQ,KAAK,OAAO,WAAa,KAClC,CAAC,CACH,EAEH,MAAM,gBAAiB,CACrB,KAAK,OAAO,QAAQ,WAAa,EAC/B,KACA,KAAK,OAAO,QAAQ,WACrB,EAEH,MAAM,SAAU,CACd,IAAM,EAAM,MAAM,EAChB,KAAK,OAAO,QAAQ,OACpB,KAAK,OAAO,QACb,CAEG,KAAK,OAAO,QAAQ,WACtB,MAAM,KAAK,GAAG,MACZ,KAAK,OAAO,QAAQ,WACpB,EAAY,EAAK,CACf,SAAU,KAAK,OAAO,QAAQ,WAC/B,CAAC,CACH,CAED,MAAM,KAAK,YAAY,EAAY,EAAI,CAAE,UAAU,EAGxD"}
1
+ {"version":3,"file":"index.mjs","names":[],"sources":["../src/index.ts"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Powerlines\n\n This code was released as part of the Powerlines project. Powerlines\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/powerlines.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/powerlines\n Documentation: https://docs.stormsoftware.com/projects/powerlines\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport { joinPaths } from \"@stryke/path/join-paths\";\nimport defu from \"defu\";\nimport openapiTS, { astToString } from \"openapi-typescript\";\nimport { Plugin } from \"powerlines\";\nimport { replacePathTokens } from \"powerlines/plugin-utils\";\nimport { OpenAPIPluginContext, OpenAPIPluginOptions } from \"./types/plugin\";\n\nexport * from \"./types\";\n\ndeclare module \"powerlines\" {\n interface Config {\n openapi?: OpenAPIPluginOptions;\n }\n}\n\n/**\n * A Powerlines plugin to integrate OpenAPI for code generation.\n *\n * @param options - The plugin options.\n * @returns A Powerlines plugin instance.\n */\nexport const plugin = <\n TContext extends OpenAPIPluginContext = OpenAPIPluginContext\n>(\n options: OpenAPIPluginOptions = {}\n): Plugin<TContext> => {\n return {\n name: \"openapi\",\n config() {\n return {\n openapi: defu(options, {\n schema: joinPaths(this.config.cwd, this.config.root, \"schema.yaml\"),\n cwd: joinPaths(this.config.cwd, this.config.root),\n outputPath: joinPaths(\"{builtinPath}\", \"api\"),\n silent: this.config.logLevel === null\n })\n };\n },\n async configResolved() {\n this.config.openapi.outputPath = replacePathTokens(\n this,\n this.config.openapi.outputPath\n );\n },\n async prepare() {\n const ast = await openapiTS(\n this.config.openapi.schema,\n this.config.openapi\n );\n\n if (this.config.openapi.outputPath) {\n await this.fs.write(\n this.config.openapi.outputPath,\n astToString(ast, {\n fileName: this.config.openapi.outputPath\n })\n );\n } else {\n await this.emitBuiltin(astToString(ast), \"openapi\");\n }\n }\n };\n};\n\nexport default plugin;\n"],"mappings":";;;;;;;;;;;;AAuCA,MAAa,UAGX,UAAgC,EAAE,KACb;AACrB,QAAO;EACL,MAAM;EACN,SAAS;AACP,UAAO,EACL,SAAS,KAAK,SAAS;IACrB,QAAQ,UAAU,KAAK,OAAO,KAAK,KAAK,OAAO,MAAM,cAAc;IACnE,KAAK,UAAU,KAAK,OAAO,KAAK,KAAK,OAAO,KAAK;IACjD,YAAY,UAAU,iBAAiB,MAAM;IAC7C,QAAQ,KAAK,OAAO,aAAa;IAClC,CAAC,EACH;;EAEH,MAAM,iBAAiB;AACrB,QAAK,OAAO,QAAQ,aAAa,kBAC/B,MACA,KAAK,OAAO,QAAQ,WACrB;;EAEH,MAAM,UAAU;GACd,MAAM,MAAM,MAAM,UAChB,KAAK,OAAO,QAAQ,QACpB,KAAK,OAAO,QACb;AAED,OAAI,KAAK,OAAO,QAAQ,WACtB,OAAM,KAAK,GAAG,MACZ,KAAK,OAAO,QAAQ,YACpB,YAAY,KAAK,EACf,UAAU,KAAK,OAAO,QAAQ,YAC/B,CAAC,CACH;OAED,OAAM,KAAK,YAAY,YAAY,IAAI,EAAE,UAAU;;EAGxD"}
@@ -1 +1 @@
1
- export{};
1
+ export { };
@@ -1 +1 @@
1
- export{};
1
+ export { };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@powerlines/plugin-openapi",
3
- "version": "0.2.461",
3
+ "version": "0.2.463",
4
4
  "type": "module",
5
5
  "description": "A Powerlines plugin to generate project code from OpenAPI specifications.",
6
6
  "repository": {
@@ -101,13 +101,13 @@
101
101
  "defu": "^6.1.7",
102
102
  "jiti": "^2.6.1",
103
103
  "openapi-typescript": "^7.13.0",
104
- "powerlines": "^0.46.3"
104
+ "powerlines": "^0.46.5"
105
105
  },
106
106
  "devDependencies": {
107
- "@powerlines/plugin-plugin": "^0.12.407",
107
+ "@powerlines/plugin-plugin": "^0.12.409",
108
108
  "@types/node": "^25.6.0"
109
109
  },
110
110
  "publishConfig": { "access": "public" },
111
111
  "types": "./dist/index.d.cts",
112
- "gitHead": "9a51041e0817e438c49db05bb757b3bdbaf497ef"
112
+ "gitHead": "9af888c54e58a82744cc334a6b80da52429fa0ac"
113
113
  }