@speclynx/apidom-parser-adapter-asyncapi-yaml-2 2.2.3 → 2.3.0
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/CHANGELOG.md +6 -0
- package/dist/apidom-parser-adapter-asyncapi-yaml-2.browser.js +38 -12
- package/dist/apidom-parser-adapter-asyncapi-yaml-2.browser.min.js +1 -1
- package/package.json +6 -6
- package/src/adapter.cjs +4 -1
- package/src/adapter.mjs +5 -1
- package/types/apidom-parser-adapter-asyncapi-yaml-2.d.ts +12 -3
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,12 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
# [2.3.0](https://github.com/speclynx/apidom/compare/v2.2.3...v2.3.0) (2026-01-27)
|
|
7
|
+
|
|
8
|
+
### Features
|
|
9
|
+
|
|
10
|
+
- support strict parsing mode through out the packages ([#46](https://github.com/speclynx/apidom/issues/46)) ([e6b47d9](https://github.com/speclynx/apidom/commit/e6b47d9cfdede7103cada67362b316fd8e5b787f)), closes [#23](https://github.com/speclynx/apidom/issues/23)
|
|
11
|
+
|
|
6
12
|
## [2.2.3](https://github.com/speclynx/apidom/compare/v2.2.2...v2.2.3) (2026-01-26)
|
|
7
13
|
|
|
8
14
|
**Note:** Version bump only for package @speclynx/apidom-parser-adapter-asyncapi-yaml-2
|
|
@@ -39056,7 +39056,8 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
39056
39056
|
/* harmony export */ });
|
|
39057
39057
|
/* harmony import */ var yaml__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(53291);
|
|
39058
39058
|
/* harmony import */ var _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(10404);
|
|
39059
|
-
/* harmony import */ var _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(
|
|
39059
|
+
/* harmony import */ var _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(84660);
|
|
39060
|
+
/* harmony import */ var _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(4823);
|
|
39060
39061
|
|
|
39061
39062
|
|
|
39062
39063
|
|
|
@@ -39064,9 +39065,15 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
39064
39065
|
* @public
|
|
39065
39066
|
*/
|
|
39066
39067
|
const detect = async source => {
|
|
39068
|
+
if (source.trim().length === 0) {
|
|
39069
|
+
return false;
|
|
39070
|
+
}
|
|
39067
39071
|
try {
|
|
39068
|
-
(0,yaml__WEBPACK_IMPORTED_MODULE_0__.
|
|
39069
|
-
|
|
39072
|
+
const document = (0,yaml__WEBPACK_IMPORTED_MODULE_0__.parseDocument)(source, {
|
|
39073
|
+
version: '1.2'
|
|
39074
|
+
});
|
|
39075
|
+
// Filter out MULTIPLE_DOCS errors (handled as warning in parse)
|
|
39076
|
+
return document.errors.filter(e => e.code !== 'MULTIPLE_DOCS').length === 0;
|
|
39070
39077
|
} catch {
|
|
39071
39078
|
return false;
|
|
39072
39079
|
}
|
|
@@ -39076,9 +39083,28 @@ const detect = async source => {
|
|
|
39076
39083
|
* @public
|
|
39077
39084
|
*/
|
|
39078
39085
|
const parse = async source => {
|
|
39079
|
-
const
|
|
39080
|
-
|
|
39081
|
-
|
|
39086
|
+
const parseResult = new _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_3__["default"]();
|
|
39087
|
+
if (source.trim().length === 0) {
|
|
39088
|
+
return parseResult;
|
|
39089
|
+
}
|
|
39090
|
+
const document = (0,yaml__WEBPACK_IMPORTED_MODULE_0__.parseDocument)(source, {
|
|
39091
|
+
version: '1.2'
|
|
39092
|
+
});
|
|
39093
|
+
|
|
39094
|
+
// Handle document errors
|
|
39095
|
+
for (const error of document.errors) {
|
|
39096
|
+
if (error.code === 'MULTIPLE_DOCS') {
|
|
39097
|
+
// Multiple documents warning (align with tree-sitter behavior)
|
|
39098
|
+
const message = 'Only first document within YAML stream will be used. Rest will be discarded.';
|
|
39099
|
+
const annotation = new _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_2__["default"](message);
|
|
39100
|
+
annotation.classes.push('warning');
|
|
39101
|
+
parseResult.push(annotation);
|
|
39102
|
+
} else {
|
|
39103
|
+
// Fatal error - throw
|
|
39104
|
+
throw error;
|
|
39105
|
+
}
|
|
39106
|
+
}
|
|
39107
|
+
const element = (0,_speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_1__.refract)(document.toJS());
|
|
39082
39108
|
element.classes.push('result');
|
|
39083
39109
|
parseResult.push(element);
|
|
39084
39110
|
return parseResult;
|
|
@@ -50238,7 +50264,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
50238
50264
|
/* harmony export */ syntacticAnalysis: () => (/* reexport safe */ _tree_sitter_index_mjs__WEBPACK_IMPORTED_MODULE_5__["default"])
|
|
50239
50265
|
/* harmony export */ });
|
|
50240
50266
|
/* harmony import */ var _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(55156);
|
|
50241
|
-
/* harmony import */ var _speclynx_apidom_error__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(
|
|
50267
|
+
/* harmony import */ var _speclynx_apidom_error__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(20746);
|
|
50242
50268
|
/* harmony import */ var _yaml_index_mjs__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(69124);
|
|
50243
50269
|
/* harmony import */ var _tree_sitter_index_mjs__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(10405);
|
|
50244
50270
|
/* harmony import */ var _tree_sitter_index_mjs__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(47657);
|
|
@@ -50278,10 +50304,6 @@ const detect = async (source, {
|
|
|
50278
50304
|
* @public
|
|
50279
50305
|
*/
|
|
50280
50306
|
|
|
50281
|
-
/**
|
|
50282
|
-
* @public
|
|
50283
|
-
*/
|
|
50284
|
-
|
|
50285
50307
|
/**
|
|
50286
50308
|
* @public
|
|
50287
50309
|
*/
|
|
@@ -55509,7 +55531,11 @@ const detectionRegExp = /(?<YAML>^(["']?)asyncapi\2\s*:\s*(["']?)(?<version_yaml
|
|
|
55509
55531
|
/**
|
|
55510
55532
|
* @public
|
|
55511
55533
|
*/
|
|
55512
|
-
const detect = async source => detectionRegExp.test(source) && (await (0,_speclynx_apidom_parser_adapter_yaml_1_2__WEBPACK_IMPORTED_MODULE_4__.detect)(source));
|
|
55534
|
+
const detect = async (source, options = {}) => detectionRegExp.test(source) && (await (0,_speclynx_apidom_parser_adapter_yaml_1_2__WEBPACK_IMPORTED_MODULE_4__.detect)(source, options));
|
|
55535
|
+
|
|
55536
|
+
/**
|
|
55537
|
+
* @public
|
|
55538
|
+
*/
|
|
55513
55539
|
|
|
55514
55540
|
/**
|
|
55515
55541
|
* @public
|