@speclynx/apidom-parser-adapter-arazzo-yaml-1 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 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-arazzo-yaml-1
@@ -34497,7 +34497,8 @@ __webpack_require__.r(__webpack_exports__);
34497
34497
  /* harmony export */ });
34498
34498
  /* harmony import */ var yaml__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(53291);
34499
34499
  /* harmony import */ var _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(10404);
34500
- /* harmony import */ var _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(4823);
34500
+ /* harmony import */ var _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(84660);
34501
+ /* harmony import */ var _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(4823);
34501
34502
 
34502
34503
 
34503
34504
 
@@ -34505,9 +34506,15 @@ __webpack_require__.r(__webpack_exports__);
34505
34506
  * @public
34506
34507
  */
34507
34508
  const detect = async source => {
34509
+ if (source.trim().length === 0) {
34510
+ return false;
34511
+ }
34508
34512
  try {
34509
- (0,yaml__WEBPACK_IMPORTED_MODULE_0__.parse)(source);
34510
- return true;
34513
+ const document = (0,yaml__WEBPACK_IMPORTED_MODULE_0__.parseDocument)(source, {
34514
+ version: '1.2'
34515
+ });
34516
+ // Filter out MULTIPLE_DOCS errors (handled as warning in parse)
34517
+ return document.errors.filter(e => e.code !== 'MULTIPLE_DOCS').length === 0;
34511
34518
  } catch {
34512
34519
  return false;
34513
34520
  }
@@ -34517,9 +34524,28 @@ const detect = async source => {
34517
34524
  * @public
34518
34525
  */
34519
34526
  const parse = async source => {
34520
- const pojo = (0,yaml__WEBPACK_IMPORTED_MODULE_0__.parse)(source);
34521
- const element = (0,_speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_1__.refract)(pojo);
34522
- const parseResult = new _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_2__["default"]();
34527
+ const parseResult = new _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_3__["default"]();
34528
+ if (source.trim().length === 0) {
34529
+ return parseResult;
34530
+ }
34531
+ const document = (0,yaml__WEBPACK_IMPORTED_MODULE_0__.parseDocument)(source, {
34532
+ version: '1.2'
34533
+ });
34534
+
34535
+ // Handle document errors
34536
+ for (const error of document.errors) {
34537
+ if (error.code === 'MULTIPLE_DOCS') {
34538
+ // Multiple documents warning (align with tree-sitter behavior)
34539
+ const message = 'Only first document within YAML stream will be used. Rest will be discarded.';
34540
+ const annotation = new _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_2__["default"](message);
34541
+ annotation.classes.push('warning');
34542
+ parseResult.push(annotation);
34543
+ } else {
34544
+ // Fatal error - throw
34545
+ throw error;
34546
+ }
34547
+ }
34548
+ const element = (0,_speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_1__.refract)(document.toJS());
34523
34549
  element.classes.push('result');
34524
34550
  parseResult.push(element);
34525
34551
  return parseResult;
@@ -41577,7 +41603,7 @@ __webpack_require__.r(__webpack_exports__);
41577
41603
  /* harmony export */ syntacticAnalysis: () => (/* reexport safe */ _tree_sitter_index_mjs__WEBPACK_IMPORTED_MODULE_5__["default"])
41578
41604
  /* harmony export */ });
41579
41605
  /* harmony import */ var _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(55156);
41580
- /* harmony import */ var _speclynx_apidom_error__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(16126);
41606
+ /* harmony import */ var _speclynx_apidom_error__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(20746);
41581
41607
  /* harmony import */ var _yaml_index_mjs__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(69124);
41582
41608
  /* harmony import */ var _tree_sitter_index_mjs__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(10405);
41583
41609
  /* harmony import */ var _tree_sitter_index_mjs__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(47657);
@@ -41617,10 +41643,6 @@ const detect = async (source, {
41617
41643
  * @public
41618
41644
  */
41619
41645
 
41620
- /**
41621
- * @public
41622
- */
41623
-
41624
41646
  /**
41625
41647
  * @public
41626
41648
  */
@@ -45906,7 +45928,11 @@ const detectionRegExp = /(?<YAML>^(["']?)arazzo\2\s*:\s*(["']?)(?<version_yaml>1
45906
45928
  /**
45907
45929
  * @public
45908
45930
  */
45909
- const detect = async source => detectionRegExp.test(source) && (await (0,_speclynx_apidom_parser_adapter_yaml_1_2__WEBPACK_IMPORTED_MODULE_4__.detect)(source));
45931
+ const detect = async (source, options = {}) => detectionRegExp.test(source) && (await (0,_speclynx_apidom_parser_adapter_yaml_1_2__WEBPACK_IMPORTED_MODULE_4__.detect)(source, options));
45932
+
45933
+ /**
45934
+ * @public
45935
+ */
45910
45936
 
45911
45937
  /**
45912
45938
  * @public