@scalar/highlight 0.2.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.
Files changed (166) hide show
  1. package/CHANGELOG.md +13 -0
  2. package/README.md +324 -0
  3. package/dist/all.d.ts +28 -0
  4. package/dist/all.d.ts.map +1 -0
  5. package/dist/all.js +105 -0
  6. package/dist/compat/hljs.d.ts +24 -0
  7. package/dist/compat/hljs.d.ts.map +1 -0
  8. package/dist/compat/hljs.js +95 -0
  9. package/dist/compat/index.d.ts +24 -0
  10. package/dist/compat/index.d.ts.map +1 -0
  11. package/dist/compat/index.js +21 -0
  12. package/dist/compat/languages.d.ts +46 -0
  13. package/dist/compat/languages.d.ts.map +1 -0
  14. package/dist/compat/languages.js +236 -0
  15. package/dist/compat/syntax-highlight.d.ts +37 -0
  16. package/dist/compat/syntax-highlight.d.ts.map +1 -0
  17. package/dist/compat/syntax-highlight.js +133 -0
  18. package/dist/core/compile.d.ts +3 -0
  19. package/dist/core/compile.d.ts.map +1 -0
  20. package/dist/core/compile.js +142 -0
  21. package/dist/core/index.d.ts +9 -0
  22. package/dist/core/index.d.ts.map +1 -0
  23. package/dist/core/index.js +5 -0
  24. package/dist/core/registry.d.ts +14 -0
  25. package/dist/core/registry.d.ts.map +1 -0
  26. package/dist/core/registry.js +77 -0
  27. package/dist/core/render.d.ts +67 -0
  28. package/dist/core/render.d.ts.map +1 -0
  29. package/dist/core/render.js +216 -0
  30. package/dist/core/scopes.d.ts +94 -0
  31. package/dist/core/scopes.d.ts.map +1 -0
  32. package/dist/core/scopes.js +113 -0
  33. package/dist/core/tokenize.d.ts +18 -0
  34. package/dist/core/tokenize.d.ts.map +1 -0
  35. package/dist/core/tokenize.js +131 -0
  36. package/dist/core/types.d.ts +99 -0
  37. package/dist/core/types.d.ts.map +1 -0
  38. package/dist/core/types.js +10 -0
  39. package/dist/index.d.ts +19 -0
  40. package/dist/index.d.ts.map +1 -0
  41. package/dist/index.js +20 -0
  42. package/dist/langs/bash.d.ts +4 -0
  43. package/dist/langs/bash.d.ts.map +1 -0
  44. package/dist/langs/bash.js +123 -0
  45. package/dist/langs/c.d.ts +4 -0
  46. package/dist/langs/c.d.ts.map +1 -0
  47. package/dist/langs/c.js +196 -0
  48. package/dist/langs/clojure.d.ts +4 -0
  49. package/dist/langs/clojure.d.ts.map +1 -0
  50. package/dist/langs/clojure.js +213 -0
  51. package/dist/langs/cpp.d.ts +4 -0
  52. package/dist/langs/cpp.d.ts.map +1 -0
  53. package/dist/langs/cpp.js +391 -0
  54. package/dist/langs/csharp.d.ts +4 -0
  55. package/dist/langs/csharp.d.ts.map +1 -0
  56. package/dist/langs/csharp.js +307 -0
  57. package/dist/langs/css.d.ts +4 -0
  58. package/dist/langs/css.d.ts.map +1 -0
  59. package/dist/langs/css.js +94 -0
  60. package/dist/langs/dart.d.ts +4 -0
  61. package/dist/langs/dart.d.ts.map +1 -0
  62. package/dist/langs/dart.js +262 -0
  63. package/dist/langs/diff.d.ts +10 -0
  64. package/dist/langs/diff.d.ts.map +1 -0
  65. package/dist/langs/diff.js +26 -0
  66. package/dist/langs/dockerfile.d.ts +4 -0
  67. package/dist/langs/dockerfile.d.ts.map +1 -0
  68. package/dist/langs/dockerfile.js +308 -0
  69. package/dist/langs/elixir.d.ts +4 -0
  70. package/dist/langs/elixir.d.ts.map +1 -0
  71. package/dist/langs/elixir.js +343 -0
  72. package/dist/langs/fsharp.d.ts +4 -0
  73. package/dist/langs/fsharp.d.ts.map +1 -0
  74. package/dist/langs/fsharp.js +330 -0
  75. package/dist/langs/go.d.ts +5 -0
  76. package/dist/langs/go.d.ts.map +1 -0
  77. package/dist/langs/go.js +90 -0
  78. package/dist/langs/graphql.d.ts +4 -0
  79. package/dist/langs/graphql.d.ts.map +1 -0
  80. package/dist/langs/graphql.js +185 -0
  81. package/dist/langs/haskell.d.ts +4 -0
  82. package/dist/langs/haskell.d.ts.map +1 -0
  83. package/dist/langs/haskell.js +375 -0
  84. package/dist/langs/html.d.ts +14 -0
  85. package/dist/langs/html.d.ts.map +1 -0
  86. package/dist/langs/html.js +71 -0
  87. package/dist/langs/http.d.ts +4 -0
  88. package/dist/langs/http.d.ts.map +1 -0
  89. package/dist/langs/http.js +185 -0
  90. package/dist/langs/ini.d.ts +4 -0
  91. package/dist/langs/ini.d.ts.map +1 -0
  92. package/dist/langs/ini.js +227 -0
  93. package/dist/langs/java.d.ts +4 -0
  94. package/dist/langs/java.d.ts.map +1 -0
  95. package/dist/langs/java.js +178 -0
  96. package/dist/langs/javascript.d.ts +4 -0
  97. package/dist/langs/javascript.d.ts.map +1 -0
  98. package/dist/langs/javascript.js +226 -0
  99. package/dist/langs/json.d.ts +10 -0
  100. package/dist/langs/json.d.ts.map +1 -0
  101. package/dist/langs/json.js +46 -0
  102. package/dist/langs/kotlin.d.ts +4 -0
  103. package/dist/langs/kotlin.d.ts.map +1 -0
  104. package/dist/langs/kotlin.js +220 -0
  105. package/dist/langs/lua.d.ts +4 -0
  106. package/dist/langs/lua.d.ts.map +1 -0
  107. package/dist/langs/lua.js +330 -0
  108. package/dist/langs/makefile.d.ts +4 -0
  109. package/dist/langs/makefile.d.ts.map +1 -0
  110. package/dist/langs/makefile.js +266 -0
  111. package/dist/langs/markdown.d.ts +11 -0
  112. package/dist/langs/markdown.d.ts.map +1 -0
  113. package/dist/langs/markdown.js +71 -0
  114. package/dist/langs/matlab.d.ts +4 -0
  115. package/dist/langs/matlab.d.ts.map +1 -0
  116. package/dist/langs/matlab.js +352 -0
  117. package/dist/langs/mojo.d.ts +4 -0
  118. package/dist/langs/mojo.d.ts.map +1 -0
  119. package/dist/langs/mojo.js +337 -0
  120. package/dist/langs/nginx.d.ts +4 -0
  121. package/dist/langs/nginx.d.ts.map +1 -0
  122. package/dist/langs/nginx.js +168 -0
  123. package/dist/langs/objectivec.d.ts +4 -0
  124. package/dist/langs/objectivec.d.ts.map +1 -0
  125. package/dist/langs/objectivec.js +287 -0
  126. package/dist/langs/ocaml.d.ts +4 -0
  127. package/dist/langs/ocaml.d.ts.map +1 -0
  128. package/dist/langs/ocaml.js +309 -0
  129. package/dist/langs/perl.d.ts +4 -0
  130. package/dist/langs/perl.d.ts.map +1 -0
  131. package/dist/langs/perl.js +435 -0
  132. package/dist/langs/php.d.ts +4 -0
  133. package/dist/langs/php.d.ts.map +1 -0
  134. package/dist/langs/php.js +325 -0
  135. package/dist/langs/powershell.d.ts +4 -0
  136. package/dist/langs/powershell.d.ts.map +1 -0
  137. package/dist/langs/powershell.js +308 -0
  138. package/dist/langs/python.d.ts +4 -0
  139. package/dist/langs/python.d.ts.map +1 -0
  140. package/dist/langs/python.js +350 -0
  141. package/dist/langs/r.d.ts +4 -0
  142. package/dist/langs/r.d.ts.map +1 -0
  143. package/dist/langs/r.js +265 -0
  144. package/dist/langs/ruby.d.ts +4 -0
  145. package/dist/langs/ruby.d.ts.map +1 -0
  146. package/dist/langs/ruby.js +365 -0
  147. package/dist/langs/rust.d.ts +10 -0
  148. package/dist/langs/rust.d.ts.map +1 -0
  149. package/dist/langs/rust.js +116 -0
  150. package/dist/langs/scala.d.ts +4 -0
  151. package/dist/langs/scala.d.ts.map +1 -0
  152. package/dist/langs/scala.js +308 -0
  153. package/dist/langs/sql.d.ts +5 -0
  154. package/dist/langs/sql.d.ts.map +1 -0
  155. package/dist/langs/sql.js +57 -0
  156. package/dist/langs/swift.d.ts +33 -0
  157. package/dist/langs/swift.d.ts.map +1 -0
  158. package/dist/langs/swift.js +256 -0
  159. package/dist/langs/yaml.d.ts +11 -0
  160. package/dist/langs/yaml.d.ts.map +1 -0
  161. package/dist/langs/yaml.js +123 -0
  162. package/dist/lazy.d.ts +69 -0
  163. package/dist/lazy.d.ts.map +1 -0
  164. package/dist/lazy.js +200 -0
  165. package/dist/style.css +308 -0
  166. package/package.json +86 -0
package/dist/style.css ADDED
@@ -0,0 +1,308 @@
1
+ /*
2
+ * @scalar/highlight — token styles.
3
+ *
4
+ * There is no theme system here. Every color is derived from the `--scalar-*`
5
+ * custom properties that `@scalar/themes` already defines, so a code block
6
+ * follows whatever theme preset the app is running and switches with
7
+ * `.light-mode` / `.dark-mode` like everything else. Nothing is re-highlighted
8
+ * when the theme changes; only these variables resolve differently.
9
+ *
10
+ * ── Why the color-mix() ────────────────────────────────────────────────────
11
+ * The semantic palette is tuned for UI — badges, labels, large text — and
12
+ * several hues are too light for 13px code on a light background. Measured
13
+ * against `--scalar-background-2`, the default theme's light values give
14
+ * yellow 1.6:1, accent 2.8:1 and orange 2.9:1; WCAG AA wants 4.5:1.
15
+ *
16
+ * So each hue is pulled toward `--scalar-color-1`, the theme's own text color.
17
+ * That keeps the hue's identity (a custom theme's green still drives strings)
18
+ * while guaranteeing it moves toward whatever contrasts with that theme's
19
+ * background — dark text on light themes, light text on dark ones. The
20
+ * percentages below are the largest share of each hue that still clears 4.5:1
21
+ * on the default theme; `test/style.test.ts` recomputes them and fails if an
22
+ * edit drops a token below AA.
23
+ *
24
+ * Dark mode needs almost no correction, so it keeps the hues at full strength.
25
+ *
26
+ * `--scalar-hl-punctuation` is the one deliberate exception. Brackets, commas
27
+ * and semicolons are structural glyphs that are never read on their own, and
28
+ * lifting them to 4.5:1 would put them level with the code around them, which
29
+ * is the opposite of what they are for. They sit at roughly 3:1 — the AA bar
30
+ * for non-text — and the test asserts that floor rather than the 4.5 one.
31
+ *
32
+ * ── Overriding ─────────────────────────────────────────────────────────────
33
+ * Fourteen semantic slots cover every scope. To recolor strings everywhere:
34
+ *
35
+ * .shl-code { --scalar-hl-string: rebeccapurple; }
36
+ */
37
+
38
+ /* ── semantic slots ─────────────────────────────────────────────────────── */
39
+ /* Defaults are the dark-mode values; they also apply when no mode class is
40
+ present, which is the common case for a dark-first app shell.
41
+ *
42
+ * `.light-mode` is in this list too, and it matters. `@scalar/themes` defines
43
+ * `--scalar-color-*` on the mode classes, not on `:root`, and a custom
44
+ * property resolves its `var()` against the element it is declared on. A slot
45
+ * declared only at `:root` therefore reads an undefined palette, becomes
46
+ * invalid, and leaves `color` to inherit plain text — which is what happened
47
+ * in light mode to every slot the block below does not override. Declaring
48
+ * them here on `.light-mode` as well resolves them against a real palette; the
49
+ * block below then overrides the ten that want a different mix in light. */
50
+ :root,
51
+ .dark-mode,
52
+ .light-mode,
53
+ .light-mode .dark-mode {
54
+ /* Grey tiers, dimmest first: punctuation < comment < muted < doc < text.
55
+ Both mixes pull toward --scalar-color-1, so the hierarchy holds on a light
56
+ theme (pulling darker) and a dark one (pulling lighter) alike. */
57
+ --scalar-hl-punctuation: var(--scalar-color-3);
58
+ --scalar-hl-comment: var(--scalar-color-2);
59
+ --scalar-hl-muted: color-mix(in oklab, var(--scalar-color-2) 70%, var(--scalar-color-1));
60
+ --scalar-hl-doc: color-mix(in oklab, var(--scalar-color-2) 50%, var(--scalar-color-1));
61
+
62
+ --scalar-hl-string: var(--scalar-color-green);
63
+ --scalar-hl-literal: var(--scalar-color-orange);
64
+ --scalar-hl-keyword: color-mix(in oklab, var(--scalar-color-red) 82%, var(--scalar-color-1));
65
+ --scalar-hl-declaration: var(--scalar-color-purple);
66
+ --scalar-hl-function: var(--scalar-color-blue);
67
+ --scalar-hl-builtin: var(--scalar-color-accent);
68
+ --scalar-hl-type: var(--scalar-color-yellow);
69
+ --scalar-hl-added: var(--scalar-color-green);
70
+ --scalar-hl-removed: color-mix(in oklab, var(--scalar-color-red) 82%, var(--scalar-color-1));
71
+ --scalar-hl-invalid: color-mix(in oklab, var(--scalar-color-red) 82%, var(--scalar-color-1));
72
+ }
73
+
74
+ .light-mode,
75
+ .dark-mode .light-mode {
76
+ --scalar-hl-comment: color-mix(in oklab, var(--scalar-color-2) 96%, var(--scalar-color-1));
77
+ --scalar-hl-string: color-mix(in oklab, var(--scalar-color-green) 85%, var(--scalar-color-1));
78
+ --scalar-hl-literal: color-mix(in oklab, var(--scalar-color-orange) 72%, var(--scalar-color-1));
79
+ --scalar-hl-keyword: color-mix(in oklab, var(--scalar-color-red) 90%, var(--scalar-color-1));
80
+ --scalar-hl-function: color-mix(in oklab, var(--scalar-color-blue) 85%, var(--scalar-color-1));
81
+ --scalar-hl-builtin: color-mix(in oklab, var(--scalar-color-accent) 70%, var(--scalar-color-1));
82
+ --scalar-hl-type: color-mix(in oklab, var(--scalar-color-yellow) 52%, var(--scalar-color-1));
83
+ --scalar-hl-added: color-mix(in oklab, var(--scalar-color-green) 85%, var(--scalar-color-1));
84
+ --scalar-hl-removed: color-mix(in oklab, var(--scalar-color-red) 90%, var(--scalar-color-1));
85
+ --scalar-hl-invalid: color-mix(in oklab, var(--scalar-color-red) 90%, var(--scalar-color-1));
86
+ }
87
+
88
+ /* ── the block ──────────────────────────────────────────────────────────── */
89
+ .shl-code {
90
+ position: relative;
91
+ margin: 0;
92
+ padding: 0;
93
+ background: var(--scalar-background-2);
94
+ color: var(--scalar-color-1);
95
+ font-family: var(--scalar-font-code);
96
+ font-size: var(--scalar-mini);
97
+ line-height: var(--shl-line-height-3);
98
+ font-variant-ligatures: none;
99
+ tab-size: 4;
100
+ border-radius: var(--scalar-radius-lg);
101
+ overflow: auto;
102
+ overscroll-behavior-x: contain;
103
+ direction: ltr;
104
+ text-align: left;
105
+ white-space: pre;
106
+ word-break: normal;
107
+ word-spacing: normal;
108
+ hyphens: none;
109
+ scrollbar-width: thin;
110
+ scrollbar-color: var(--scalar-scrollbar-color) transparent;
111
+ -webkit-text-size-adjust: 100%;
112
+ }
113
+
114
+ .shl-code::-webkit-scrollbar {
115
+ height: 9px;
116
+ width: 9px;
117
+ }
118
+ .shl-code::-webkit-scrollbar-track {
119
+ background: transparent;
120
+ }
121
+ .shl-code::-webkit-scrollbar-thumb {
122
+ background: var(--scalar-scrollbar-color);
123
+ border-radius: var(--scalar-radius-full);
124
+ }
125
+ .shl-code::-webkit-scrollbar-thumb:hover {
126
+ background: var(--scalar-scrollbar-color-active);
127
+ }
128
+ .shl-code:focus-visible {
129
+ outline: 2px solid var(--scalar-color-accent);
130
+ outline-offset: 2px;
131
+ }
132
+ .shl-code ::selection {
133
+ background: var(--scalar-background-accent);
134
+ }
135
+
136
+ .shl-code > code {
137
+ display: block;
138
+ /* fit-content with a 100% floor lets a highlighted line's background span
139
+ the full scroll width instead of stopping at the viewport edge. */
140
+ width: fit-content;
141
+ min-width: 100%;
142
+ padding: 12px 16px;
143
+ font: inherit;
144
+ color: inherit;
145
+ background: none;
146
+ border: 0;
147
+ }
148
+
149
+ /* ── lines and the gutter ───────────────────────────────────────────────── */
150
+ .shl-code-lined > code {
151
+ padding-left: 0;
152
+ padding-right: 0;
153
+ }
154
+ .shl-code-lined .shl-line {
155
+ display: block;
156
+ padding: 0 16px;
157
+ /* Keeps a blank line the height of a text line. */
158
+ min-height: 1lh;
159
+ }
160
+ .shl-code-numbered > code {
161
+ counter-reset: shl-line;
162
+ }
163
+ .shl-code-numbered .shl-line::before {
164
+ counter-increment: shl-line;
165
+ content: counter(shl-line);
166
+ display: inline-block;
167
+ /*
168
+ * Sized for the widest number in the block, so the code starts at the same
169
+ * column on line 9 and line 10. `highlightBlock` sets `--shl-line-digits`;
170
+ * the fallback covers markup rendered before that existed, and the `max`
171
+ * keeps a narrow block from looking cramped.
172
+ */
173
+ min-width: max(2ch, calc(var(--shl-line-digits, 2) * 1ch));
174
+ margin-right: 1.25em;
175
+ text-align: right;
176
+ color: var(--scalar-color-3);
177
+ font-variant-numeric: tabular-nums;
178
+ user-select: none;
179
+ -webkit-user-select: none;
180
+ }
181
+ .shl-code-lined .shl-line[data-hl] {
182
+ background: var(--scalar-background-3);
183
+ box-shadow: inset 2px 0 0 var(--scalar-color-accent);
184
+ }
185
+
186
+ .shl-code[data-lang]::after {
187
+ content: attr(data-lang);
188
+ position: absolute;
189
+ top: 8px;
190
+ right: 10px;
191
+ font-size: var(--scalar-micro);
192
+ letter-spacing: 0.06em;
193
+ text-transform: uppercase;
194
+ color: var(--scalar-color-3);
195
+ pointer-events: none;
196
+ }
197
+
198
+ /* ── tokens ─────────────────────────────────────────────────────────────── */
199
+ /* Plain identifiers and member access carry no class at all and inherit
200
+ --scalar-color-1, which keeps both the markup and the noise down. */
201
+ .shl-code .shl-cm {
202
+ color: var(--scalar-hl-comment);
203
+ font-style: italic;
204
+ }
205
+ .shl-code .shl-cd {
206
+ color: var(--scalar-hl-doc);
207
+ font-style: italic;
208
+ }
209
+
210
+ .shl-code .shl-s,
211
+ .shl-code .shl-rx {
212
+ color: var(--scalar-hl-string);
213
+ }
214
+
215
+ .shl-code .shl-se,
216
+ .shl-code .shl-ss,
217
+ .shl-code .shl-ip,
218
+ .shl-code .shl-n,
219
+ .shl-code .shl-bo,
220
+ .shl-code .shl-c,
221
+ .shl-code .shl-cb,
222
+ .shl-code .shl-u {
223
+ color: var(--scalar-hl-literal);
224
+ }
225
+
226
+ .shl-code .shl-vb {
227
+ color: var(--scalar-hl-literal);
228
+ font-style: italic;
229
+ }
230
+
231
+ .shl-code .shl-k,
232
+ .shl-code .shl-kc,
233
+ .shl-code .shl-ko,
234
+ .shl-code .shl-tg,
235
+ .shl-code .shl-li {
236
+ color: var(--scalar-hl-keyword);
237
+ }
238
+
239
+ .shl-code .shl-kd,
240
+ .shl-code .shl-ki,
241
+ .shl-code .shl-dc {
242
+ color: var(--scalar-hl-declaration);
243
+ }
244
+ .shl-code .shl-vs {
245
+ color: var(--scalar-hl-declaration);
246
+ font-style: italic;
247
+ }
248
+
249
+ .shl-code .shl-f,
250
+ .shl-code .shl-fc,
251
+ .shl-code .shl-fm,
252
+ .shl-code .shl-pr {
253
+ color: var(--scalar-hl-function);
254
+ }
255
+ .shl-code .shl-h {
256
+ color: var(--scalar-hl-function);
257
+ font-weight: var(--scalar-bold);
258
+ }
259
+
260
+ .shl-code .shl-fb,
261
+ .shl-code .shl-o {
262
+ color: var(--scalar-hl-builtin);
263
+ }
264
+ .shl-code .shl-ln {
265
+ color: var(--scalar-hl-builtin);
266
+ text-decoration: underline;
267
+ }
268
+
269
+ .shl-code .shl-t,
270
+ .shl-code .shl-tb,
271
+ .shl-code .shl-cl,
272
+ .shl-code .shl-ta,
273
+ .shl-code .shl-sl {
274
+ color: var(--scalar-hl-type);
275
+ }
276
+
277
+ .shl-code .shl-ns,
278
+ .shl-code .shl-pb {
279
+ color: var(--scalar-hl-muted);
280
+ }
281
+ .shl-code .shl-vp,
282
+ .shl-code .shl-q {
283
+ color: var(--scalar-hl-muted);
284
+ font-style: italic;
285
+ }
286
+
287
+ .shl-code .shl-p,
288
+ .shl-code .shl-pd {
289
+ color: var(--scalar-hl-punctuation);
290
+ }
291
+
292
+ .shl-code .shl-em {
293
+ font-style: italic;
294
+ }
295
+ .shl-code .shl-sg {
296
+ font-weight: var(--scalar-bold);
297
+ }
298
+
299
+ .shl-code .shl-dp {
300
+ color: var(--scalar-hl-added);
301
+ }
302
+ .shl-code .shl-dm {
303
+ color: var(--scalar-hl-removed);
304
+ }
305
+ .shl-code .shl-iv {
306
+ color: var(--scalar-hl-invalid);
307
+ text-decoration: underline wavy;
308
+ }
package/package.json ADDED
@@ -0,0 +1,86 @@
1
+ {
2
+ "name": "@scalar/highlight",
3
+ "description": "Scalar's code highlighter",
4
+ "license": "MIT",
5
+ "author": "Scalar (https://github.com/scalar)",
6
+ "homepage": "https://github.com/scalar/scalar",
7
+ "bugs": "https://github.com/scalar/scalar/issues/new/choose",
8
+ "repository": {
9
+ "type": "git",
10
+ "url": "git+https://github.com/scalar/scalar.git",
11
+ "directory": "packages/highlight"
12
+ },
13
+ "keywords": [
14
+ "syntax-highlighting",
15
+ "highlight",
16
+ "code",
17
+ "performance"
18
+ ],
19
+ "version": "0.2.0",
20
+ "engines": {
21
+ "node": ">=22"
22
+ },
23
+ "scripts": {
24
+ "bench": "tsx bench/bench.ts",
25
+ "build": "tsc -p tsconfig.build.json && tsc-alias -p tsconfig.build.json && shx cp src/style.css dist/style.css",
26
+ "compat:report": "tsx bench/compat-report.ts",
27
+ "size": "tsx bench/size.ts",
28
+ "test": "vitest --run",
29
+ "test:watch": "vitest",
30
+ "types:check": "tsgo --noEmit"
31
+ },
32
+ "type": "module",
33
+ "main": "dist/index.js",
34
+ "module": "dist/index.js",
35
+ "exports": {
36
+ ".": {
37
+ "import": "./dist/index.js",
38
+ "types": "./dist/index.d.ts",
39
+ "default": "./dist/index.js"
40
+ },
41
+ "./all": {
42
+ "import": "./dist/all.js",
43
+ "types": "./dist/all.d.ts",
44
+ "default": "./dist/all.js"
45
+ },
46
+ "./compat": {
47
+ "import": "./dist/compat/index.js",
48
+ "types": "./dist/compat/index.d.ts",
49
+ "default": "./dist/compat/index.js"
50
+ },
51
+ "./core": {
52
+ "import": "./dist/core/index.js",
53
+ "types": "./dist/core/index.d.ts",
54
+ "default": "./dist/core/index.js"
55
+ },
56
+ "./langs/*": {
57
+ "import": "./dist/langs/*.js",
58
+ "types": "./dist/langs/*.d.ts",
59
+ "default": "./dist/langs/*.js"
60
+ },
61
+ "./lazy": {
62
+ "import": "./dist/lazy.js",
63
+ "types": "./dist/lazy.d.ts",
64
+ "default": "./dist/lazy.js"
65
+ },
66
+ "./style.css": {
67
+ "import": "./dist/style.css",
68
+ "require": "./dist/style.css",
69
+ "default": "./dist/style.css"
70
+ }
71
+ },
72
+ "files": [
73
+ "dist",
74
+ "CHANGELOG.md"
75
+ ],
76
+ "sideEffects": [
77
+ "dist/all.js",
78
+ "**/*.css"
79
+ ],
80
+ "devDependencies": {
81
+ "@scalar/code-highlight": "workspace:*",
82
+ "highlight.js": "catalog:*",
83
+ "rolldown": "catalog:*",
84
+ "vitest": "catalog:*"
85
+ }
86
+ }