@swagger-api/apidom-parser-adapter-openapi-yaml-2 1.8.0 → 1.10.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,14 @@
|
|
|
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
|
+
# [1.10.0](https://github.com/swagger-api/apidom/compare/v1.9.0...v1.10.0) (2026-04-01)
|
|
7
|
+
|
|
8
|
+
**Note:** Version bump only for package @swagger-api/apidom-parser-adapter-openapi-yaml-2
|
|
9
|
+
|
|
10
|
+
# [1.9.0](https://github.com/swagger-api/apidom/compare/v1.8.0...v1.9.0) (2026-03-30)
|
|
11
|
+
|
|
12
|
+
**Note:** Version bump only for package @swagger-api/apidom-parser-adapter-openapi-yaml-2
|
|
13
|
+
|
|
6
14
|
# [1.8.0](https://github.com/swagger-api/apidom/compare/v1.7.0...v1.8.0) (2026-03-20)
|
|
7
15
|
|
|
8
16
|
**Note:** Version bump only for package @swagger-api/apidom-parser-adapter-openapi-yaml-2
|
|
@@ -19485,7 +19485,8 @@
|
|
|
19485
19485
|
|
|
19486
19486
|
let parser = null;
|
|
19487
19487
|
let parserInitLock = null;
|
|
19488
|
-
|
|
19488
|
+
const activeTrees = new Set();
|
|
19489
|
+
const MAX_ACTIVE_TREES = 5;
|
|
19489
19490
|
const createAnalyze = treeSitterYaml => async source => {
|
|
19490
19491
|
if (parser === null && parserInitLock === null) {
|
|
19491
19492
|
// acquire lock
|
|
@@ -19505,9 +19506,28 @@
|
|
|
19505
19506
|
if (parser === null) {
|
|
19506
19507
|
throw new ApiDOMError('Error while initializing web-tree-sitter and loading tree-sitter-yaml grammar.');
|
|
19507
19508
|
}
|
|
19508
|
-
|
|
19509
|
+
|
|
19510
|
+
// prevent WASM OOM during concurrency spikes by evicting oldest trees
|
|
19511
|
+
// when the pool exceeds threshold; tree.delete() is idempotent so
|
|
19512
|
+
// callers that still hold a reference can safely call delete() again
|
|
19513
|
+
if (activeTrees.size >= MAX_ACTIVE_TREES) {
|
|
19514
|
+
const treesToEvict = [...activeTrees];
|
|
19515
|
+
activeTrees.clear();
|
|
19516
|
+
for (const oldTree of treesToEvict) {
|
|
19517
|
+
oldTree.delete();
|
|
19518
|
+
}
|
|
19519
|
+
}
|
|
19520
|
+
const tree = parser.parse(source);
|
|
19521
|
+
activeTrees.add(tree);
|
|
19522
|
+
|
|
19523
|
+
// remove from tracking when caller deletes
|
|
19524
|
+
const originalDelete = tree.delete;
|
|
19525
|
+
tree.delete = function deleteAndUntrack() {
|
|
19526
|
+
activeTrees.delete(this);
|
|
19527
|
+
originalDelete.call(this);
|
|
19528
|
+
};
|
|
19509
19529
|
parser.reset();
|
|
19510
|
-
return
|
|
19530
|
+
return tree;
|
|
19511
19531
|
};
|
|
19512
19532
|
|
|
19513
19533
|
/**
|
|
@@ -20368,13 +20388,16 @@
|
|
|
20368
20388
|
* @public
|
|
20369
20389
|
*/
|
|
20370
20390
|
const detect$1 = async source => {
|
|
20391
|
+
let cst = null;
|
|
20371
20392
|
try {
|
|
20372
|
-
|
|
20373
|
-
|
|
20374
|
-
cst.delete();
|
|
20375
|
-
return isError;
|
|
20393
|
+
cst = await analyze$1(source);
|
|
20394
|
+
return !cst.rootNode.isError;
|
|
20376
20395
|
} catch {
|
|
20377
20396
|
return false;
|
|
20397
|
+
} finally {
|
|
20398
|
+
if (cst !== null) {
|
|
20399
|
+
cst.delete();
|
|
20400
|
+
}
|
|
20378
20401
|
}
|
|
20379
20402
|
};
|
|
20380
20403
|
|
|
@@ -20392,12 +20415,17 @@
|
|
|
20392
20415
|
const parse$1 = async (source, {
|
|
20393
20416
|
sourceMap = false
|
|
20394
20417
|
} = {}) => {
|
|
20395
|
-
|
|
20396
|
-
|
|
20397
|
-
|
|
20398
|
-
|
|
20399
|
-
|
|
20400
|
-
|
|
20418
|
+
let cst = null;
|
|
20419
|
+
try {
|
|
20420
|
+
cst = await analyze$1(source);
|
|
20421
|
+
return analyze(cst, {
|
|
20422
|
+
sourceMap
|
|
20423
|
+
});
|
|
20424
|
+
} finally {
|
|
20425
|
+
if (cst !== null) {
|
|
20426
|
+
cst.delete();
|
|
20427
|
+
}
|
|
20428
|
+
}
|
|
20401
20429
|
};
|
|
20402
20430
|
|
|
20403
20431
|
/**
|