@powerlines/plugin-asyncapi 0.1.652 → 0.1.654

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
@@ -37,15 +37,17 @@ const plugin = (options) => {
37
37
  },
38
38
  async configResolved() {
39
39
  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\".");
40
- if (!this.config.asyncapi.document || !isLoadedDocument(this.config.asyncapi.document)) if (isLoadedDocument(this.config.asyncapi.schema)) this.config.asyncapi.document = this.config.asyncapi.schema;
41
- else if ((0, _stryke_fs_exists.existsSync)(this.config.asyncapi.schema.toString())) {
42
- const document = await this.fs.read(this.config.asyncapi.schema.toString());
43
- if (!document) throw new Error(`Failed to read AsyncAPI schema from file: ${this.config.asyncapi.schema.toString()}`);
44
- this.config.asyncapi.document = document;
45
- } else {
46
- const document = await this.fetch(this.config.asyncapi.schema.toString());
47
- if (!document) throw new Error(`Failed to fetch AsyncAPI schema from endpoint: ${this.config.asyncapi.schema.toString()}`);
48
- this.config.asyncapi.document = await document.text();
40
+ if (!this.config.asyncapi.document || !isLoadedDocument(this.config.asyncapi.document)) {
41
+ if (isLoadedDocument(this.config.asyncapi.schema)) this.config.asyncapi.document = this.config.asyncapi.schema;
42
+ else if ((0, _stryke_fs_exists.existsSync)(this.config.asyncapi.schema.toString())) {
43
+ const document = await this.fs.read(this.config.asyncapi.schema.toString());
44
+ if (!document) throw new Error(`Failed to read AsyncAPI schema from file: ${this.config.asyncapi.schema.toString()}`);
45
+ this.config.asyncapi.document = document;
46
+ } else {
47
+ const document = await this.fetch(this.config.asyncapi.schema.toString());
48
+ if (!document) throw new Error(`Failed to fetch AsyncAPI schema from endpoint: ${this.config.asyncapi.schema.toString()}`);
49
+ this.config.asyncapi.document = await document.text();
50
+ }
49
51
  }
50
52
  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\".");
51
53
  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\".");
package/dist/index.mjs CHANGED
@@ -32,15 +32,17 @@ const plugin = (options) => {
32
32
  },
33
33
  async configResolved() {
34
34
  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\".");
35
- if (!this.config.asyncapi.document || !isLoadedDocument(this.config.asyncapi.document)) if (isLoadedDocument(this.config.asyncapi.schema)) this.config.asyncapi.document = this.config.asyncapi.schema;
36
- else if (existsSync(this.config.asyncapi.schema.toString())) {
37
- const document = await this.fs.read(this.config.asyncapi.schema.toString());
38
- if (!document) throw new Error(`Failed to read AsyncAPI schema from file: ${this.config.asyncapi.schema.toString()}`);
39
- this.config.asyncapi.document = document;
40
- } else {
41
- const document = await this.fetch(this.config.asyncapi.schema.toString());
42
- if (!document) throw new Error(`Failed to fetch AsyncAPI schema from endpoint: ${this.config.asyncapi.schema.toString()}`);
43
- this.config.asyncapi.document = await document.text();
35
+ if (!this.config.asyncapi.document || !isLoadedDocument(this.config.asyncapi.document)) {
36
+ if (isLoadedDocument(this.config.asyncapi.schema)) this.config.asyncapi.document = this.config.asyncapi.schema;
37
+ else if (existsSync(this.config.asyncapi.schema.toString())) {
38
+ const document = await this.fs.read(this.config.asyncapi.schema.toString());
39
+ if (!document) throw new Error(`Failed to read AsyncAPI schema from file: ${this.config.asyncapi.schema.toString()}`);
40
+ this.config.asyncapi.document = document;
41
+ } else {
42
+ const document = await this.fetch(this.config.asyncapi.schema.toString());
43
+ if (!document) throw new Error(`Failed to fetch AsyncAPI schema from endpoint: ${this.config.asyncapi.schema.toString()}`);
44
+ this.config.asyncapi.document = await document.text();
45
+ }
44
46
  }
45
47
  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\".");
46
48
  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\".");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@powerlines/plugin-asyncapi",
3
- "version": "0.1.652",
3
+ "version": "0.1.654",
4
4
  "type": "module",
5
5
  "description": "A Powerlines plugin to generate project code from AsyncAPI specifications.",
6
6
  "repository": {
@@ -89,19 +89,19 @@
89
89
  "files": ["dist/**/*"],
90
90
  "keywords": ["asyncapi", "powerlines", "storm-software", "powerlines-plugin"],
91
91
  "dependencies": {
92
- "@power-plant/asyncapi": "^0.0.66",
93
- "@power-plant/core": "^0.0.70",
94
- "@powerlines/plugin-power-plant": "0.1.43",
92
+ "@power-plant/asyncapi": "^0.0.76",
93
+ "@power-plant/core": "^0.0.80",
94
+ "@powerlines/plugin-power-plant": "^0.1.45",
95
95
  "@stryke/fs": "^0.33.103",
96
96
  "@stryke/path": "^0.29.29",
97
97
  "defu": "^6.1.7",
98
- "powerlines": "0.47.187"
98
+ "powerlines": "^0.47.189"
99
99
  },
100
100
  "devDependencies": {
101
- "@powerlines/plugin-plugin": "0.12.599",
101
+ "@powerlines/plugin-plugin": "^0.12.601",
102
102
  "@types/node": "^25.9.5"
103
103
  },
104
104
  "publishConfig": { "access": "public" },
105
105
  "types": "./dist/index.d.cts",
106
- "gitHead": "df1dfd7812d5b8f53a29b72b9dd3158a7743e24b"
106
+ "gitHead": "4f019d4d8ba65510735df7f5cc5fab5e50f99860"
107
107
  }