@powerlines/plugin-asyncapi 0.1.3 → 0.1.4

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.
@@ -1328,7 +1328,7 @@ interface AsyncAPIPluginOptions {
1328
1328
  *
1329
1329
  * @defaultValue "\{builtinPath\}/asyncapi"
1330
1330
  */
1331
- generatedPath?: string;
1331
+ outputPath?: string;
1332
1332
  /**
1333
1333
  * Name of the file to use as the entry point for the rendering process. Use in case you want to use only a specific template file. Note: this potentially avoids rendering every file in the template.
1334
1334
  */
@@ -1383,10 +1383,10 @@ interface AsyncAPIPluginOptions {
1383
1383
  mapBaseUrlToFolder?: Record<string, string>;
1384
1384
  }
1385
1385
  type AsyncAPIPluginUserConfig = UserConfig & {
1386
- asyncapi?: GeneratorOptions & Required<Pick<AsyncAPIPluginOptions, "schema" | "templateName" | "generatedPath">>;
1386
+ asyncapi?: GeneratorOptions & Required<Pick<AsyncAPIPluginOptions, "schema" | "templateName" | "outputPath">>;
1387
1387
  };
1388
1388
  type AsyncAPIPluginResolvedConfig = ResolvedConfig & {
1389
- asyncapi: GeneratorOptions & Required<Pick<AsyncAPIPluginOptions, "schema" | "templateName" | "generatedPath">> & {
1389
+ asyncapi: GeneratorOptions & Required<Pick<AsyncAPIPluginOptions, "schema" | "templateName" | "outputPath">> & {
1390
1390
  document: string | AsyncAPIDocument;
1391
1391
  };
1392
1392
  };
@@ -1328,7 +1328,7 @@ interface AsyncAPIPluginOptions {
1328
1328
  *
1329
1329
  * @defaultValue "\{builtinPath\}/asyncapi"
1330
1330
  */
1331
- generatedPath?: string;
1331
+ outputPath?: string;
1332
1332
  /**
1333
1333
  * Name of the file to use as the entry point for the rendering process. Use in case you want to use only a specific template file. Note: this potentially avoids rendering every file in the template.
1334
1334
  */
@@ -1383,10 +1383,10 @@ interface AsyncAPIPluginOptions {
1383
1383
  mapBaseUrlToFolder?: Record<string, string>;
1384
1384
  }
1385
1385
  type AsyncAPIPluginUserConfig = UserConfig & {
1386
- asyncapi?: GeneratorOptions & Required<Pick<AsyncAPIPluginOptions, "schema" | "templateName" | "generatedPath">>;
1386
+ asyncapi?: GeneratorOptions & Required<Pick<AsyncAPIPluginOptions, "schema" | "templateName" | "outputPath">>;
1387
1387
  };
1388
1388
  type AsyncAPIPluginResolvedConfig = ResolvedConfig & {
1389
- asyncapi: GeneratorOptions & Required<Pick<AsyncAPIPluginOptions, "schema" | "templateName" | "generatedPath">> & {
1389
+ asyncapi: GeneratorOptions & Required<Pick<AsyncAPIPluginOptions, "schema" | "templateName" | "outputPath">> & {
1390
1390
  document: string | AsyncAPIDocument;
1391
1391
  };
1392
1392
  };
@@ -1,7 +1,7 @@
1
- 'use strict';Object.defineProperty(exports,'__esModule',{value:true});var generator=require('@asyncapi/generator'),document=require('@asyncapi/parser/esm/document'),bufferToString=require('@stryke/convert/buffer-to-string'),exists=require('@stryke/fs/exists'),packageFns=require('@stryke/fs/package-fns'),fetch=require('@stryke/http/fetch'),join=require('@stryke/path/join'),g=require('defu'),types=require('./types');function _interopDefault(e){return e&&e.__esModule?e:{default:e}}var g__default=/*#__PURE__*/_interopDefault(g);/*****************************************
1
+ 'use strict';Object.defineProperty(exports,'__esModule',{value:true});var generator=require('@asyncapi/generator'),document=require('@asyncapi/parser/esm/document'),bufferToString=require('@stryke/convert/buffer-to-string'),exists=require('@stryke/fs/exists'),packageFns=require('@stryke/fs/package-fns'),fetch=require('@stryke/http/fetch'),join=require('@stryke/path/join'),m=require('defu'),paths=require('powerlines/plugin-utils/paths'),types=require('./types');function _interopDefault(e){return e&&e.__esModule?e:{default:e}}var m__default=/*#__PURE__*/_interopDefault(m);/*****************************************
2
2
  *
3
3
  * ⚡ Built by Storm Software
4
4
  *
5
5
  *****************************************/
6
6
 
7
- var o=Object.defineProperty;var n=(e,i)=>o(e,"name",{value:i,configurable:true});const h=n(e=>({name:"asyncapi",config(){return {asyncapi:g__default.default(e,{schema:join.joinPaths(this.workspaceConfig.workspaceRoot,this.config.projectRoot,"schema.yaml"),output:"string",install:false,compile:false,debug:this.config.mode==="development"||this.config.logLevel==="debug"||this.config.logLevel==="trace",targetDir:join.joinPaths(this.builtinsPath,"asyncapi")})}},async configResolved(){if(!this.config.asyncapi.schema)throw new Error('AsyncAPI schema is required. Please specify it in the plugin options or your Powerlines configuration under "asyncapi.schema".');if(!this.config.asyncapi.document||!document.isAsyncAPIDocument(this.config.asyncapi.document))if(document.isAsyncAPIDocument(this.config.asyncapi.schema))this.config.asyncapi.document=this.config.asyncapi.schema;else if(exists.existsSync(this.config.asyncapi.schema.toString())){const i=await this.fs.readFile(this.config.asyncapi.schema.toString());if(!i)throw new Error(`Failed to read AsyncAPI schema from file: ${this.config.asyncapi.schema.toString()}`);this.config.asyncapi.document=i;}else {const i=await fetch.fetchRequest(this.config.asyncapi.schema.toString());if(!i)throw new Error(`Failed to fetch AsyncAPI schema from endpoint: ${this.config.asyncapi.schema.toString()}`);this.config.asyncapi.document=bufferToString.bufferToString(i);}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".');if(!this.config.asyncapi.generatedPath)throw new Error('AsyncAPI generated path is required. Please specify it in the plugin options or your Powerlines configuration under "asyncapi.generatedPath".');!exists.existsSync(this.config.asyncapi.templateName)&&!packageFns.isPackageExists(this.config.asyncapi.templateName)&&(this.devDependencies[this.config.asyncapi.templateName]="latest"),this.config.asyncapi.generatedPath=this.config.asyncapi.generatedPath.replace("{builtinPath}",this.builtinsPath);},async prepare(){await new generator.Generator(this.config.asyncapi.templateName,this.config.asyncapi.generatedPath,this.config.asyncapi).generate(this.config.asyncapi.document);}}),"plugin");var q=h;exports.default=q;exports.plugin=h;Object.keys(types).forEach(function(k){if(k!=='default'&&!Object.prototype.hasOwnProperty.call(exports,k))Object.defineProperty(exports,k,{enumerable:true,get:function(){return types[k]}})});
7
+ var a=Object.defineProperty;var n=(t,i)=>a(t,"name",{value:i,configurable:true});const g=n(t=>({name:"asyncapi",config(){return {asyncapi:m__default.default(t,{schema:join.joinPaths(this.workspaceConfig.workspaceRoot,this.config.projectRoot,"schema.yaml"),output:"string",install:false,compile:false,debug:this.config.mode==="development"||this.config.logLevel==="debug"||this.config.logLevel==="trace",targetDir:join.joinPaths(this.builtinsPath,"asyncapi")})}},async configResolved(){if(!this.config.asyncapi.schema)throw new Error('AsyncAPI schema is required. Please specify it in the plugin options or your Powerlines configuration under "asyncapi.schema".');if(!this.config.asyncapi.document||!document.isAsyncAPIDocument(this.config.asyncapi.document))if(document.isAsyncAPIDocument(this.config.asyncapi.schema))this.config.asyncapi.document=this.config.asyncapi.schema;else if(exists.existsSync(this.config.asyncapi.schema.toString())){const i=await this.fs.readFile(this.config.asyncapi.schema.toString());if(!i)throw new Error(`Failed to read AsyncAPI schema from file: ${this.config.asyncapi.schema.toString()}`);this.config.asyncapi.document=i;}else {const i=await fetch.fetchRequest(this.config.asyncapi.schema.toString());if(!i)throw new Error(`Failed to fetch AsyncAPI schema from endpoint: ${this.config.asyncapi.schema.toString()}`);this.config.asyncapi.document=bufferToString.bufferToString(i);}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".');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".');!exists.existsSync(this.config.asyncapi.templateName)&&!packageFns.isPackageExists(this.config.asyncapi.templateName)&&(this.devDependencies[this.config.asyncapi.templateName]="latest"),this.config.asyncapi.outputPath=paths.replacePathTokens(this,this.config.asyncapi.outputPath);},async prepare(){await new generator.Generator(this.config.asyncapi.templateName,this.config.asyncapi.outputPath,this.config.asyncapi).generate(this.config.asyncapi.document);}}),"plugin");var R=g;exports.default=R;exports.plugin=g;Object.keys(types).forEach(function(k){if(k!=='default'&&!Object.prototype.hasOwnProperty.call(exports,k))Object.defineProperty(exports,k,{enumerable:true,get:function(){return types[k]}})});
@@ -1,5 +1,5 @@
1
- import { A as AsyncAPIPluginContext, a as AsyncAPIPluginOptions, P as Plugin } from '../index-odQr7bjv.cjs';
2
- export { c as AsyncAPIPluginResolvedConfig, b as AsyncAPIPluginUserConfig } from '../index-odQr7bjv.cjs';
1
+ import { A as AsyncAPIPluginContext, a as AsyncAPIPluginOptions, P as Plugin } from '../index-DHPwyUfU.cjs';
2
+ export { c as AsyncAPIPluginResolvedConfig, b as AsyncAPIPluginUserConfig } from '../index-DHPwyUfU.cjs';
3
3
  import '@asyncapi/generator';
4
4
  import '@asyncapi/parser/esm/models/v3/asyncapi';
5
5
  import '@storm-software/build-tools/types';
@@ -1,5 +1,5 @@
1
- import { A as AsyncAPIPluginContext, a as AsyncAPIPluginOptions, P as Plugin } from '../index-odQr7bjv.js';
2
- export { c as AsyncAPIPluginResolvedConfig, b as AsyncAPIPluginUserConfig } from '../index-odQr7bjv.js';
1
+ import { A as AsyncAPIPluginContext, a as AsyncAPIPluginOptions, P as Plugin } from '../index-DHPwyUfU.js';
2
+ export { c as AsyncAPIPluginResolvedConfig, b as AsyncAPIPluginUserConfig } from '../index-DHPwyUfU.js';
3
3
  import '@asyncapi/generator';
4
4
  import '@asyncapi/parser/esm/models/v3/asyncapi';
5
5
  import '@storm-software/build-tools/types';
package/dist/src/index.js CHANGED
@@ -1,7 +1,7 @@
1
- import {Generator}from'@asyncapi/generator';import {isAsyncAPIDocument}from'@asyncapi/parser/esm/document';import {bufferToString}from'@stryke/convert/buffer-to-string';import {existsSync}from'@stryke/fs/exists';import {isPackageExists}from'@stryke/fs/package-fns';import {fetchRequest}from'@stryke/http/fetch';import {joinPaths}from'@stryke/path/join';import g from'defu';export*from'./types';/*****************************************
1
+ import {Generator}from'@asyncapi/generator';import {isAsyncAPIDocument}from'@asyncapi/parser/esm/document';import {bufferToString}from'@stryke/convert/buffer-to-string';import {existsSync}from'@stryke/fs/exists';import {isPackageExists}from'@stryke/fs/package-fns';import {fetchRequest}from'@stryke/http/fetch';import {joinPaths}from'@stryke/path/join';import m from'defu';import {replacePathTokens}from'powerlines/plugin-utils/paths';export*from'./types';/*****************************************
2
2
  *
3
3
  * ⚡ Built by Storm Software
4
4
  *
5
5
  *****************************************/
6
6
 
7
- var o=Object.defineProperty;var n=(e,i)=>o(e,"name",{value:i,configurable:true});const h=n(e=>({name:"asyncapi",config(){return {asyncapi:g(e,{schema:joinPaths(this.workspaceConfig.workspaceRoot,this.config.projectRoot,"schema.yaml"),output:"string",install:false,compile:false,debug:this.config.mode==="development"||this.config.logLevel==="debug"||this.config.logLevel==="trace",targetDir:joinPaths(this.builtinsPath,"asyncapi")})}},async configResolved(){if(!this.config.asyncapi.schema)throw new Error('AsyncAPI schema is required. Please specify it in the plugin options or your Powerlines configuration under "asyncapi.schema".');if(!this.config.asyncapi.document||!isAsyncAPIDocument(this.config.asyncapi.document))if(isAsyncAPIDocument(this.config.asyncapi.schema))this.config.asyncapi.document=this.config.asyncapi.schema;else if(existsSync(this.config.asyncapi.schema.toString())){const i=await this.fs.readFile(this.config.asyncapi.schema.toString());if(!i)throw new Error(`Failed to read AsyncAPI schema from file: ${this.config.asyncapi.schema.toString()}`);this.config.asyncapi.document=i;}else {const i=await fetchRequest(this.config.asyncapi.schema.toString());if(!i)throw new Error(`Failed to fetch AsyncAPI schema from endpoint: ${this.config.asyncapi.schema.toString()}`);this.config.asyncapi.document=bufferToString(i);}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".');if(!this.config.asyncapi.generatedPath)throw new Error('AsyncAPI generated path is required. Please specify it in the plugin options or your Powerlines configuration under "asyncapi.generatedPath".');!existsSync(this.config.asyncapi.templateName)&&!isPackageExists(this.config.asyncapi.templateName)&&(this.devDependencies[this.config.asyncapi.templateName]="latest"),this.config.asyncapi.generatedPath=this.config.asyncapi.generatedPath.replace("{builtinPath}",this.builtinsPath);},async prepare(){await new Generator(this.config.asyncapi.templateName,this.config.asyncapi.generatedPath,this.config.asyncapi).generate(this.config.asyncapi.document);}}),"plugin");var R=h;export{R as default,h as plugin};
7
+ var a=Object.defineProperty;var n=(t,i)=>a(t,"name",{value:i,configurable:true});const g=n(t=>({name:"asyncapi",config(){return {asyncapi:m(t,{schema:joinPaths(this.workspaceConfig.workspaceRoot,this.config.projectRoot,"schema.yaml"),output:"string",install:false,compile:false,debug:this.config.mode==="development"||this.config.logLevel==="debug"||this.config.logLevel==="trace",targetDir:joinPaths(this.builtinsPath,"asyncapi")})}},async configResolved(){if(!this.config.asyncapi.schema)throw new Error('AsyncAPI schema is required. Please specify it in the plugin options or your Powerlines configuration under "asyncapi.schema".');if(!this.config.asyncapi.document||!isAsyncAPIDocument(this.config.asyncapi.document))if(isAsyncAPIDocument(this.config.asyncapi.schema))this.config.asyncapi.document=this.config.asyncapi.schema;else if(existsSync(this.config.asyncapi.schema.toString())){const i=await this.fs.readFile(this.config.asyncapi.schema.toString());if(!i)throw new Error(`Failed to read AsyncAPI schema from file: ${this.config.asyncapi.schema.toString()}`);this.config.asyncapi.document=i;}else {const i=await fetchRequest(this.config.asyncapi.schema.toString());if(!i)throw new Error(`Failed to fetch AsyncAPI schema from endpoint: ${this.config.asyncapi.schema.toString()}`);this.config.asyncapi.document=bufferToString(i);}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".');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".');!existsSync(this.config.asyncapi.templateName)&&!isPackageExists(this.config.asyncapi.templateName)&&(this.devDependencies[this.config.asyncapi.templateName]="latest"),this.config.asyncapi.outputPath=replacePathTokens(this,this.config.asyncapi.outputPath);},async prepare(){await new Generator(this.config.asyncapi.templateName,this.config.asyncapi.outputPath,this.config.asyncapi).generate(this.config.asyncapi.document);}}),"plugin");var T=g;export{T as default,g as plugin};
@@ -1,4 +1,4 @@
1
- export { A as AsyncAPIPluginContext, a as AsyncAPIPluginOptions, c as AsyncAPIPluginResolvedConfig, b as AsyncAPIPluginUserConfig } from '../index-odQr7bjv.cjs';
1
+ export { A as AsyncAPIPluginContext, a as AsyncAPIPluginOptions, c as AsyncAPIPluginResolvedConfig, b as AsyncAPIPluginUserConfig } from '../index-DHPwyUfU.cjs';
2
2
  import '@asyncapi/generator';
3
3
  import '@asyncapi/parser/esm/models/v3/asyncapi';
4
4
  import '@storm-software/build-tools/types';
@@ -1,4 +1,4 @@
1
- export { A as AsyncAPIPluginContext, a as AsyncAPIPluginOptions, c as AsyncAPIPluginResolvedConfig, b as AsyncAPIPluginUserConfig } from '../index-odQr7bjv.js';
1
+ export { A as AsyncAPIPluginContext, a as AsyncAPIPluginOptions, c as AsyncAPIPluginResolvedConfig, b as AsyncAPIPluginUserConfig } from '../index-DHPwyUfU.js';
2
2
  import '@asyncapi/generator';
3
3
  import '@asyncapi/parser/esm/models/v3/asyncapi';
4
4
  import '@storm-software/build-tools/types';
@@ -1,6 +1,6 @@
1
1
  import '@asyncapi/generator';
2
2
  import '@asyncapi/parser/esm/models/v3/asyncapi';
3
- export { A as AsyncAPIPluginContext, a as AsyncAPIPluginOptions, c as AsyncAPIPluginResolvedConfig, b as AsyncAPIPluginUserConfig } from '../index-odQr7bjv.cjs';
3
+ export { A as AsyncAPIPluginContext, a as AsyncAPIPluginOptions, c as AsyncAPIPluginResolvedConfig, b as AsyncAPIPluginUserConfig } from '../index-DHPwyUfU.cjs';
4
4
  import '@storm-software/build-tools/types';
5
5
  import '@storm-software/config-tools/types';
6
6
  import '@storm-software/config/types';
@@ -1,6 +1,6 @@
1
1
  import '@asyncapi/generator';
2
2
  import '@asyncapi/parser/esm/models/v3/asyncapi';
3
- export { A as AsyncAPIPluginContext, a as AsyncAPIPluginOptions, c as AsyncAPIPluginResolvedConfig, b as AsyncAPIPluginUserConfig } from '../index-odQr7bjv.js';
3
+ export { A as AsyncAPIPluginContext, a as AsyncAPIPluginOptions, c as AsyncAPIPluginResolvedConfig, b as AsyncAPIPluginUserConfig } from '../index-DHPwyUfU.js';
4
4
  import '@storm-software/build-tools/types';
5
5
  import '@storm-software/config-tools/types';
6
6
  import '@storm-software/config/types';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@powerlines/plugin-asyncapi",
3
- "version": "0.1.3",
3
+ "version": "0.1.4",
4
4
  "type": "module",
5
5
  "description": "A Powerlines plugin to generate project code from AsyncAPI specifications.",
6
6
  "repository": {
@@ -106,13 +106,13 @@
106
106
  "@stryke/http": "^0.11.1",
107
107
  "@stryke/path": "^0.18.5",
108
108
  "defu": "^6.1.4",
109
- "powerlines": "^0.15.0"
109
+ "powerlines": "^0.16.0"
110
110
  },
111
111
  "devDependencies": {
112
- "@powerlines/nx": "^0.10.0",
113
- "@powerlines/plugin-plugin": "^0.11.8",
112
+ "@powerlines/nx": "^0.10.1",
113
+ "@powerlines/plugin-plugin": "^0.11.9",
114
114
  "@types/node": "^22.19.0"
115
115
  },
116
116
  "publishConfig": { "access": "public" },
117
- "gitHead": "b64f9a9d53b6eb8054c361da347f6623a7ba9e45"
117
+ "gitHead": "097e9f257b733719a3aead815ef79686f4c46f25"
118
118
  }