@markuplint/pretenders 0.0.25 → 5.0.0-alpha.1

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
+ # [5.0.0-alpha.1](https://github.com/markuplint/markuplint/compare/v5.0.0-alpha.0...v5.0.0-alpha.1) (2026-02-22)
7
+
8
+ **Note:** Version bump only for package @markuplint/pretenders
9
+
10
+ # [5.0.0-alpha.0](https://github.com/markuplint/markuplint/compare/v4.14.1...v5.0.0-alpha.0) (2026-02-20)
11
+
12
+ **Note:** Version bump only for package @markuplint/pretenders
13
+
6
14
  ## [0.0.25](https://github.com/markuplint/markuplint/compare/@markuplint/pretenders@0.0.24...@markuplint/pretenders@0.0.25) (2026-02-10)
7
15
 
8
16
  **Note:** Version bump only for package @markuplint/pretenders
@@ -1,18 +1,10 @@
1
- var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {
2
- if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
3
- if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
4
- return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
5
- };
6
- var _PretenderDirector_map;
7
1
  /**
8
2
  * Collects and manages pretender mappings discovered during source file scanning.
9
3
  * Acts as a registry where component-to-element relationships are added during
10
4
  * traversal, then resolved into a flat list of pretenders with dependency linking.
11
5
  */
12
6
  export class PretenderDirector {
13
- constructor() {
14
- _PretenderDirector_map.set(this, new Map());
15
- }
7
+ #map = new Map();
16
8
  /**
17
9
  * Registers a component as a pretender mapping. If the identifier is already
18
10
  * registered, the call is silently ignored (first definition wins).
@@ -24,10 +16,10 @@ export class PretenderDirector {
24
16
  * @param col - The column number of the component declaration
25
17
  */
26
18
  add(identifier, identity, filePath, line, col) {
27
- if (__classPrivateFieldGet(this, _PretenderDirector_map, "f").has(identifier)) {
19
+ if (this.#map.has(identifier)) {
28
20
  return;
29
21
  }
30
- __classPrivateFieldGet(this, _PretenderDirector_map, "f").set(identifier, [identity, `${filePath}:${line}:${col}`]);
22
+ this.#map.set(identifier, [identity, `${filePath}:${line}:${col}`]);
31
23
  }
32
24
  /**
33
25
  * Resolves all registered mappings into a sorted array of Pretender objects.
@@ -36,10 +28,9 @@ export class PretenderDirector {
36
28
  * @returns A sorted array of resolved Pretender objects
37
29
  */
38
30
  getPretenders() {
39
- return dependencyMapper(__classPrivateFieldGet(this, _PretenderDirector_map, "f"));
31
+ return dependencyMapper(this.#map);
40
32
  }
41
33
  }
42
- _PretenderDirector_map = new WeakMap();
43
34
  /**
44
35
  * Resolves a map of component-to-identity mappings into a flat array of Pretender objects.
45
36
  * Follows chains where one component wraps another (e.g., MyButton -> Button -> button)
@@ -84,7 +75,7 @@ export function dependencyMapper(map) {
84
75
  }
85
76
  linkedPretenders.push(pretender);
86
77
  }
87
- return linkedPretenders.sort(propSort('selector'));
78
+ return linkedPretenders.toSorted(propSort('selector'));
88
79
  }
89
80
  function getElName(identity) {
90
81
  if (typeof identity === 'string') {
@@ -1,9 +1,3 @@
1
- var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {
2
- if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
3
- if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
4
- return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
5
- };
6
- var _PretenderDirector_map;
7
1
  import { dependencyMapper } from './dependency-mapper.js';
8
2
  /**
9
3
  * Collects and manages pretender mappings discovered during source file scanning.
@@ -11,9 +5,7 @@ import { dependencyMapper } from './dependency-mapper.js';
11
5
  * traversal, then resolved into a flat list of pretenders with dependency linking.
12
6
  */
13
7
  export class PretenderDirector {
14
- constructor() {
15
- _PretenderDirector_map.set(this, new Map());
16
- }
8
+ #map = new Map();
17
9
  /**
18
10
  * Registers a component as a pretender mapping. If the identifier is already
19
11
  * registered, the call is silently ignored (first definition wins).
@@ -25,10 +17,10 @@ export class PretenderDirector {
25
17
  * @param col - The column number of the component declaration
26
18
  */
27
19
  add(identifier, identity, filePath, line, col) {
28
- if (__classPrivateFieldGet(this, _PretenderDirector_map, "f").has(identifier)) {
20
+ if (this.#map.has(identifier)) {
29
21
  return;
30
22
  }
31
- __classPrivateFieldGet(this, _PretenderDirector_map, "f").set(identifier, [identity, `${filePath}:${line}:${col}`]);
23
+ this.#map.set(identifier, [identity, `${filePath}:${line}:${col}`]);
32
24
  }
33
25
  /**
34
26
  * Resolves all registered mappings into a sorted array of Pretender objects.
@@ -37,7 +29,6 @@ export class PretenderDirector {
37
29
  * @returns A sorted array of resolved Pretender objects
38
30
  */
39
31
  getPretenders() {
40
- return dependencyMapper(__classPrivateFieldGet(this, _PretenderDirector_map, "f"));
32
+ return dependencyMapper(this.#map);
41
33
  }
42
34
  }
43
- _PretenderDirector_map = new WeakMap();
package/package.json CHANGED
@@ -1,10 +1,13 @@
1
1
  {
2
2
  "name": "@markuplint/pretenders",
3
- "version": "0.0.25",
3
+ "version": "5.0.0-alpha.1",
4
4
  "description": "It loads components and then creates the pretenders data from them.",
5
5
  "repository": "git@github.com:markuplint/markuplint.git",
6
6
  "author": "Yusuke Hirao <yusukehirao@me.com>",
7
7
  "license": "MIT",
8
+ "engines": {
9
+ "node": ">=22"
10
+ },
8
11
  "type": "module",
9
12
  "exports": {
10
13
  ".": {
@@ -25,11 +28,11 @@
25
28
  "clean": "tsc --build --clean tsconfig.build.json"
26
29
  },
27
30
  "dependencies": {
28
- "@markuplint/ml-config": "4.8.15",
29
- "@markuplint/parser-utils": "4.8.11",
30
- "glob": "13.0.1",
31
- "meow": "13.2.0",
31
+ "@markuplint/ml-config": "5.0.0-alpha.1",
32
+ "@markuplint/parser-utils": "5.0.0-alpha.1",
33
+ "glob": "13.0.6",
34
+ "meow": "14.1.0",
32
35
  "typescript": "5.9.3"
33
36
  },
34
- "gitHead": "193ee7c1262bbed95424e38efdf1a8e56ff049f4"
37
+ "gitHead": "78a295e73a097a1ce09c777c06fa21ab68136387"
35
38
  }