satorigear 0.0.5 → 0.0.7
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/README.md +21 -68
- package/dist/index.d.mts +21 -4
- package/dist/index.mjs +2856 -2939
- package/package.json +3 -2
package/README.md
CHANGED
|
@@ -41,6 +41,7 @@ const parser = createParser({
|
|
|
41
41
|
attributes: true,
|
|
42
42
|
binding: true,
|
|
43
43
|
component: true,
|
|
44
|
+
emoji: true,
|
|
44
45
|
footnote: true,
|
|
45
46
|
frontmatter: true,
|
|
46
47
|
math: true,
|
|
@@ -59,101 +60,53 @@ document.edit([
|
|
|
59
60
|
{ start: 66, end: 66, text: ":" },
|
|
60
61
|
{ start: 67, end: 67, text: "nuxt-img" },
|
|
61
62
|
]);
|
|
62
|
-
const mdast = document.
|
|
63
|
+
const mdast = document.tree;
|
|
63
64
|
```
|
|
64
65
|
|
|
65
66
|
## Performance
|
|
66
67
|
|
|
67
|
-
Benchmarked against Sätteri and Remark, which also
|
|
68
|
+
Benchmarked against Sätteri <sup>0.10.5</sup> and Remark (`mdast-util-from-markdown@2.0.3`), which also return eagerly materialized MDAST, with feature sets kept as equivalent as possible for each profile.
|
|
68
69
|
|
|
69
70
|
<!-- benchmark:start environment -->
|
|
70
71
|
|
|
71
|
-
> Median of 5 isolated mean-time runs at commit [`
|
|
72
|
+
> Median of 5 isolated mean-time runs at commit [`0e6349b`](https://github.com/KazariEX/satorigear/commit/0e6349b5cf4722efc88d0f763204d61b42d9e870) on Apple M3, node 26.5.0, arm64-darwin. SatoriGear and Sätteri run in paired AB/BA order; comparisons are normalized to SatoriGear (↑ faster, ↓ slower). Lower time and higher throughput are better.
|
|
72
73
|
|
|
73
74
|
<!-- benchmark:end -->
|
|
74
75
|
|
|
75
|
-
<!-- benchmark:start parse
|
|
76
|
+
<!-- benchmark:start parse -->
|
|
76
77
|
|
|
77
|
-
|
|
78
|
-
<summary><strong>Parse only</strong></summary>
|
|
78
|
+
### CommonMark
|
|
79
79
|
|
|
80
|
-
#### CommonMark
|
|
81
|
-
|
|
82
|
-
##### CommonMark 0.31.2 specification, 205025 bytes, 1 document
|
|
80
|
+
#### CommonMark 0.31.2 specification, 205025 bytes, 1 document
|
|
83
81
|
|
|
84
82
|
| Engine | Mean time | vs. SatoriGear | Throughput |
|
|
85
83
|
| --- | ---: | ---: | ---: |
|
|
86
|
-
| **SatoriGear** |
|
|
87
|
-
| Sätteri | 1.
|
|
88
|
-
| Remark |
|
|
84
|
+
| **SatoriGear** | 1.10 ms | baseline | 178 MiB/s |
|
|
85
|
+
| Sätteri | 1.19 ms | ↓ 1.09× | 164 MiB/s |
|
|
86
|
+
| Remark | 62.5 ms | ↓ 56.63× | 3.13 MiB/s |
|
|
89
87
|
|
|
90
|
-
|
|
88
|
+
#### CommonMark 0.31.2 examples, 14919 bytes, 652 documents
|
|
91
89
|
|
|
92
90
|
| Engine | Mean time | vs. SatoriGear | Throughput |
|
|
93
91
|
| --- | ---: | ---: | ---: |
|
|
94
|
-
| **SatoriGear** |
|
|
95
|
-
| Sätteri | 2.
|
|
96
|
-
| Remark | 26.
|
|
92
|
+
| **SatoriGear** | 742 µs | baseline | 19.2 MiB/s |
|
|
93
|
+
| Sätteri | 2.20 ms | ↓ 2.97× | 6.45 MiB/s |
|
|
94
|
+
| Remark | 26.2 ms | ↓ 35.25× | 0.54 MiB/s |
|
|
97
95
|
|
|
98
|
-
|
|
96
|
+
### Built-in features
|
|
99
97
|
|
|
100
|
-
|
|
98
|
+
#### Rust release history, 910115 bytes, 1 document
|
|
101
99
|
|
|
102
100
|
| Engine | Mean time | vs. SatoriGear | Throughput |
|
|
103
101
|
| --- | ---: | ---: | ---: |
|
|
104
|
-
| **SatoriGear** |
|
|
105
|
-
| Sätteri |
|
|
102
|
+
| **SatoriGear** | 14.5 ms | baseline | 59.7 MiB/s |
|
|
103
|
+
| Sätteri | 14.9 ms | ↓ 1.03× | 58.2 MiB/s |
|
|
106
104
|
|
|
107
|
-
|
|
105
|
+
#### Public APIs README, 232580 bytes, 1 document
|
|
108
106
|
|
|
109
107
|
| Engine | Mean time | vs. SatoriGear | Throughput |
|
|
110
108
|
| --- | ---: | ---: | ---: |
|
|
111
|
-
| **SatoriGear** |
|
|
112
|
-
| Sätteri |
|
|
113
|
-
|
|
114
|
-
</details>
|
|
115
|
-
|
|
116
|
-
<!-- benchmark:end -->
|
|
117
|
-
|
|
118
|
-
<!-- benchmark:start fully materialized -->
|
|
119
|
-
|
|
120
|
-
<details>
|
|
121
|
-
<summary><strong>Fully materialized</strong></summary>
|
|
122
|
-
|
|
123
|
-
#### CommonMark
|
|
124
|
-
|
|
125
|
-
##### CommonMark 0.31.2 specification, 205025 bytes, 1 document
|
|
126
|
-
|
|
127
|
-
| Engine | Mean time | vs. SatoriGear | Throughput |
|
|
128
|
-
| --- | ---: | ---: | ---: |
|
|
129
|
-
| **SatoriGear** | 2.15 ms | baseline | 91.0 MiB/s |
|
|
130
|
-
| Sätteri | 5.52 ms | ↓ 2.57× | 35.4 MiB/s |
|
|
131
|
-
| Remark | 60.5 ms | ↓ 28.08× | 3.23 MiB/s |
|
|
132
|
-
|
|
133
|
-
##### CommonMark 0.31.2 examples, 14919 bytes, 652 documents
|
|
134
|
-
|
|
135
|
-
| Engine | Mean time | vs. SatoriGear | Throughput |
|
|
136
|
-
| --- | ---: | ---: | ---: |
|
|
137
|
-
| **SatoriGear** | 989 µs | baseline | 14.4 MiB/s |
|
|
138
|
-
| Sätteri | 5.95 ms | ↓ 5.98× | 2.39 MiB/s |
|
|
139
|
-
| Remark | 26.5 ms | ↓ 26.84× | 0.54 MiB/s |
|
|
140
|
-
|
|
141
|
-
#### Built-in features
|
|
142
|
-
|
|
143
|
-
##### Rust release history, 910115 bytes, 1 document
|
|
144
|
-
|
|
145
|
-
| Engine | Mean time | vs. SatoriGear | Throughput |
|
|
146
|
-
| --- | ---: | ---: | ---: |
|
|
147
|
-
| **SatoriGear** | 21.0 ms | baseline | 41.2 MiB/s |
|
|
148
|
-
| Sätteri | 79.3 ms | ↓ 3.78× | 10.9 MiB/s |
|
|
149
|
-
|
|
150
|
-
##### Public APIs README, 232580 bytes, 1 document
|
|
151
|
-
|
|
152
|
-
| Engine | Mean time | vs. SatoriGear | Throughput |
|
|
153
|
-
| --- | ---: | ---: | ---: |
|
|
154
|
-
| **SatoriGear** | 5.02 ms | baseline | 44.2 MiB/s |
|
|
155
|
-
| Sätteri | 20.9 ms | ↓ 4.14× | 10.6 MiB/s |
|
|
156
|
-
|
|
157
|
-
</details>
|
|
109
|
+
| **SatoriGear** | 3.37 ms | baseline | 65.8 MiB/s |
|
|
110
|
+
| Sätteri | 3.96 ms | ↓ 1.17× | 56.0 MiB/s |
|
|
158
111
|
|
|
159
112
|
<!-- benchmark:end -->
|
package/dist/index.d.mts
CHANGED
|
@@ -4,18 +4,19 @@ interface SourceSpan {
|
|
|
4
4
|
end: number;
|
|
5
5
|
start: number;
|
|
6
6
|
}
|
|
7
|
+
//#endregion
|
|
8
|
+
//#region src/document.d.ts
|
|
7
9
|
interface TextEdit extends SourceSpan {
|
|
8
10
|
text: string;
|
|
9
11
|
}
|
|
10
|
-
//#endregion
|
|
11
|
-
//#region src/document.d.ts
|
|
12
12
|
interface EditResult {
|
|
13
13
|
changedSpan: SourceSpan;
|
|
14
14
|
}
|
|
15
15
|
interface Document {
|
|
16
16
|
readonly source: string;
|
|
17
|
+
/** The document-owned tree. Edits mutate this value; callers must not morph it. */
|
|
18
|
+
readonly tree: Root;
|
|
17
19
|
edit: (edits: readonly TextEdit[]) => EditResult;
|
|
18
|
-
snapshot: () => Root;
|
|
19
20
|
}
|
|
20
21
|
//#endregion
|
|
21
22
|
//#region src/profile/features/formatting.d.ts
|
|
@@ -58,6 +59,7 @@ interface FeatureOptions {
|
|
|
58
59
|
attributes?: boolean;
|
|
59
60
|
binding?: boolean;
|
|
60
61
|
component?: boolean;
|
|
62
|
+
emoji?: boolean;
|
|
61
63
|
footnote?: boolean;
|
|
62
64
|
frontmatter?: boolean | FrontmatterOptions;
|
|
63
65
|
math?: boolean | MathOptions;
|
|
@@ -113,4 +115,19 @@ declare module "mdast" {
|
|
|
113
115
|
}
|
|
114
116
|
}
|
|
115
117
|
//#endregion
|
|
116
|
-
|
|
118
|
+
//#region src/profile/features/emoji/types.d.ts
|
|
119
|
+
interface Emoji extends Literal {
|
|
120
|
+
type: "emoji";
|
|
121
|
+
/** Complete shortcode source, including both colons. */
|
|
122
|
+
value: string;
|
|
123
|
+
}
|
|
124
|
+
declare module "mdast" {
|
|
125
|
+
interface PhrasingContentMap {
|
|
126
|
+
emoji: Emoji;
|
|
127
|
+
}
|
|
128
|
+
interface RootContentMap {
|
|
129
|
+
emoji: Emoji;
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
//#endregion
|
|
133
|
+
export { type AttributeValue, type Attributes, type BlockComponent, type Document, type EditResult, type Emoji, type FeatureOptions, type FrontmatterMarker, type FrontmatterOptions, type InlineComponent, type InlineMath, type Math, type MathOptions, Parser, ParserOptions, type StrikethroughOptions, type TextEdit, createParser };
|