shiki 3.22.0 → 4.0.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.
@@ -1,366 +1,362 @@
1
- import { createSingletonShorthands, guessEmbeddedLanguages, createBundledHighlighter } from '@shikijs/core';
2
- export * from '@shikijs/core';
3
- import { bundledThemes } from './themes.mjs';
4
- export { bundledThemesInfo } from './themes.mjs';
5
- import { createOnigurumaEngine } from '@shikijs/engine-oniguruma';
1
+ import { n as __reExport, t as __exportAll } from "./chunk-CtajNgzt.mjs";
2
+ import { t as engine_oniguruma_exports } from "./engine-oniguruma.mjs";
3
+ import { bundledThemes, bundledThemesInfo } from "./themes.mjs";
4
+ import { createBundledHighlighter, createSingletonShorthands, guessEmbeddedLanguages } from "@shikijs/core";
6
5
 
6
+ export * from "@shikijs/core"
7
+
8
+ //#region src/langs-bundle-web.ts
7
9
  const bundledLanguagesInfo = [
8
- {
9
- "id": "angular-html",
10
- "name": "Angular HTML",
11
- "import": (() => import('@shikijs/langs/angular-html'))
12
- },
13
- {
14
- "id": "angular-ts",
15
- "name": "Angular TypeScript",
16
- "import": (() => import('@shikijs/langs/angular-ts'))
17
- },
18
- {
19
- "id": "astro",
20
- "name": "Astro",
21
- "import": (() => import('@shikijs/langs/astro'))
22
- },
23
- {
24
- "id": "blade",
25
- "name": "Blade",
26
- "import": (() => import('@shikijs/langs/blade'))
27
- },
28
- {
29
- "id": "c",
30
- "name": "C",
31
- "import": (() => import('@shikijs/langs/c'))
32
- },
33
- {
34
- "id": "coffee",
35
- "name": "CoffeeScript",
36
- "aliases": [
37
- "coffeescript"
38
- ],
39
- "import": (() => import('@shikijs/langs/coffee'))
40
- },
41
- {
42
- "id": "cpp",
43
- "name": "C++",
44
- "aliases": [
45
- "c++"
46
- ],
47
- "import": (() => import('@shikijs/langs/cpp'))
48
- },
49
- {
50
- "id": "css",
51
- "name": "CSS",
52
- "import": (() => import('@shikijs/langs/css'))
53
- },
54
- {
55
- "id": "csv",
56
- "name": "CSV",
57
- "import": (() => import('@shikijs/langs/csv'))
58
- },
59
- {
60
- "id": "glsl",
61
- "name": "GLSL",
62
- "import": (() => import('@shikijs/langs/glsl'))
63
- },
64
- {
65
- "id": "graphql",
66
- "name": "GraphQL",
67
- "aliases": [
68
- "gql"
69
- ],
70
- "import": (() => import('@shikijs/langs/graphql'))
71
- },
72
- {
73
- "id": "haml",
74
- "name": "Ruby Haml",
75
- "import": (() => import('@shikijs/langs/haml'))
76
- },
77
- {
78
- "id": "handlebars",
79
- "name": "Handlebars",
80
- "aliases": [
81
- "hbs"
82
- ],
83
- "import": (() => import('@shikijs/langs/handlebars'))
84
- },
85
- {
86
- "id": "html",
87
- "name": "HTML",
88
- "import": (() => import('@shikijs/langs/html'))
89
- },
90
- {
91
- "id": "html-derivative",
92
- "name": "HTML (Derivative)",
93
- "import": (() => import('@shikijs/langs/html-derivative'))
94
- },
95
- {
96
- "id": "http",
97
- "name": "HTTP",
98
- "import": (() => import('@shikijs/langs/http'))
99
- },
100
- {
101
- "id": "hurl",
102
- "name": "Hurl",
103
- "import": (() => import('@shikijs/langs/hurl'))
104
- },
105
- {
106
- "id": "imba",
107
- "name": "Imba",
108
- "import": (() => import('@shikijs/langs/imba'))
109
- },
110
- {
111
- "id": "java",
112
- "name": "Java",
113
- "import": (() => import('@shikijs/langs/java'))
114
- },
115
- {
116
- "id": "javascript",
117
- "name": "JavaScript",
118
- "aliases": [
119
- "js",
120
- "cjs",
121
- "mjs"
122
- ],
123
- "import": (() => import('@shikijs/langs/javascript'))
124
- },
125
- {
126
- "id": "jinja",
127
- "name": "Jinja",
128
- "import": (() => import('@shikijs/langs/jinja'))
129
- },
130
- {
131
- "id": "jison",
132
- "name": "Jison",
133
- "import": (() => import('@shikijs/langs/jison'))
134
- },
135
- {
136
- "id": "json",
137
- "name": "JSON",
138
- "import": (() => import('@shikijs/langs/json'))
139
- },
140
- {
141
- "id": "json5",
142
- "name": "JSON5",
143
- "import": (() => import('@shikijs/langs/json5'))
144
- },
145
- {
146
- "id": "jsonc",
147
- "name": "JSON with Comments",
148
- "import": (() => import('@shikijs/langs/jsonc'))
149
- },
150
- {
151
- "id": "jsonl",
152
- "name": "JSON Lines",
153
- "import": (() => import('@shikijs/langs/jsonl'))
154
- },
155
- {
156
- "id": "jsx",
157
- "name": "JSX",
158
- "import": (() => import('@shikijs/langs/jsx'))
159
- },
160
- {
161
- "id": "julia",
162
- "name": "Julia",
163
- "aliases": [
164
- "jl"
165
- ],
166
- "import": (() => import('@shikijs/langs/julia'))
167
- },
168
- {
169
- "id": "less",
170
- "name": "Less",
171
- "import": (() => import('@shikijs/langs/less'))
172
- },
173
- {
174
- "id": "markdown",
175
- "name": "Markdown",
176
- "aliases": [
177
- "md"
178
- ],
179
- "import": (() => import('@shikijs/langs/markdown'))
180
- },
181
- {
182
- "id": "marko",
183
- "name": "Marko",
184
- "import": (() => import('@shikijs/langs/marko'))
185
- },
186
- {
187
- "id": "mdc",
188
- "name": "MDC",
189
- "import": (() => import('@shikijs/langs/mdc'))
190
- },
191
- {
192
- "id": "mdx",
193
- "name": "MDX",
194
- "import": (() => import('@shikijs/langs/mdx'))
195
- },
196
- {
197
- "id": "php",
198
- "name": "PHP",
199
- "import": (() => import('@shikijs/langs/php'))
200
- },
201
- {
202
- "id": "postcss",
203
- "name": "PostCSS",
204
- "import": (() => import('@shikijs/langs/postcss'))
205
- },
206
- {
207
- "id": "pug",
208
- "name": "Pug",
209
- "aliases": [
210
- "jade"
211
- ],
212
- "import": (() => import('@shikijs/langs/pug'))
213
- },
214
- {
215
- "id": "python",
216
- "name": "Python",
217
- "aliases": [
218
- "py"
219
- ],
220
- "import": (() => import('@shikijs/langs/python'))
221
- },
222
- {
223
- "id": "r",
224
- "name": "R",
225
- "import": (() => import('@shikijs/langs/r'))
226
- },
227
- {
228
- "id": "regexp",
229
- "name": "RegExp",
230
- "aliases": [
231
- "regex"
232
- ],
233
- "import": (() => import('@shikijs/langs/regexp'))
234
- },
235
- {
236
- "id": "sass",
237
- "name": "Sass",
238
- "import": (() => import('@shikijs/langs/sass'))
239
- },
240
- {
241
- "id": "scss",
242
- "name": "SCSS",
243
- "import": (() => import('@shikijs/langs/scss'))
244
- },
245
- {
246
- "id": "shellscript",
247
- "name": "Shell",
248
- "aliases": [
249
- "bash",
250
- "sh",
251
- "shell",
252
- "zsh"
253
- ],
254
- "import": (() => import('@shikijs/langs/shellscript'))
255
- },
256
- {
257
- "id": "sql",
258
- "name": "SQL",
259
- "import": (() => import('@shikijs/langs/sql'))
260
- },
261
- {
262
- "id": "stylus",
263
- "name": "Stylus",
264
- "aliases": [
265
- "styl"
266
- ],
267
- "import": (() => import('@shikijs/langs/stylus'))
268
- },
269
- {
270
- "id": "svelte",
271
- "name": "Svelte",
272
- "import": (() => import('@shikijs/langs/svelte'))
273
- },
274
- {
275
- "id": "ts-tags",
276
- "name": "TypeScript with Tags",
277
- "aliases": [
278
- "lit"
279
- ],
280
- "import": (() => import('@shikijs/langs/ts-tags'))
281
- },
282
- {
283
- "id": "tsx",
284
- "name": "TSX",
285
- "import": (() => import('@shikijs/langs/tsx'))
286
- },
287
- {
288
- "id": "typescript",
289
- "name": "TypeScript",
290
- "aliases": [
291
- "ts",
292
- "cts",
293
- "mts"
294
- ],
295
- "import": (() => import('@shikijs/langs/typescript'))
296
- },
297
- {
298
- "id": "vue",
299
- "name": "Vue",
300
- "import": (() => import('@shikijs/langs/vue'))
301
- },
302
- {
303
- "id": "vue-html",
304
- "name": "Vue HTML",
305
- "import": (() => import('@shikijs/langs/vue-html'))
306
- },
307
- {
308
- "id": "vue-vine",
309
- "name": "Vue Vine",
310
- "import": (() => import('@shikijs/langs/vue-vine'))
311
- },
312
- {
313
- "id": "wasm",
314
- "name": "WebAssembly",
315
- "import": (() => import('@shikijs/langs/wasm'))
316
- },
317
- {
318
- "id": "wgsl",
319
- "name": "WGSL",
320
- "import": (() => import('@shikijs/langs/wgsl'))
321
- },
322
- {
323
- "id": "wit",
324
- "name": "WebAssembly Interface Types",
325
- "import": (() => import('@shikijs/langs/wit'))
326
- },
327
- {
328
- "id": "xml",
329
- "name": "XML",
330
- "import": (() => import('@shikijs/langs/xml'))
331
- },
332
- {
333
- "id": "yaml",
334
- "name": "YAML",
335
- "aliases": [
336
- "yml"
337
- ],
338
- "import": (() => import('@shikijs/langs/yaml'))
339
- }
10
+ {
11
+ "id": "angular-html",
12
+ "name": "Angular HTML",
13
+ "import": (() => import("@shikijs/langs/angular-html"))
14
+ },
15
+ {
16
+ "id": "angular-ts",
17
+ "name": "Angular TypeScript",
18
+ "import": (() => import("@shikijs/langs/angular-ts"))
19
+ },
20
+ {
21
+ "id": "astro",
22
+ "name": "Astro",
23
+ "import": (() => import("@shikijs/langs/astro"))
24
+ },
25
+ {
26
+ "id": "blade",
27
+ "name": "Blade",
28
+ "import": (() => import("@shikijs/langs/blade"))
29
+ },
30
+ {
31
+ "id": "c",
32
+ "name": "C",
33
+ "import": (() => import("@shikijs/langs/c"))
34
+ },
35
+ {
36
+ "id": "coffee",
37
+ "name": "CoffeeScript",
38
+ "aliases": ["coffeescript"],
39
+ "import": (() => import("@shikijs/langs/coffee"))
40
+ },
41
+ {
42
+ "id": "cpp",
43
+ "name": "C++",
44
+ "aliases": ["c++"],
45
+ "import": (() => import("@shikijs/langs/cpp"))
46
+ },
47
+ {
48
+ "id": "css",
49
+ "name": "CSS",
50
+ "import": (() => import("@shikijs/langs/css"))
51
+ },
52
+ {
53
+ "id": "csv",
54
+ "name": "CSV",
55
+ "import": (() => import("@shikijs/langs/csv"))
56
+ },
57
+ {
58
+ "id": "glsl",
59
+ "name": "GLSL",
60
+ "import": (() => import("@shikijs/langs/glsl"))
61
+ },
62
+ {
63
+ "id": "graphql",
64
+ "name": "GraphQL",
65
+ "aliases": ["gql"],
66
+ "import": (() => import("@shikijs/langs/graphql"))
67
+ },
68
+ {
69
+ "id": "haml",
70
+ "name": "Ruby Haml",
71
+ "import": (() => import("@shikijs/langs/haml"))
72
+ },
73
+ {
74
+ "id": "handlebars",
75
+ "name": "Handlebars",
76
+ "aliases": ["hbs"],
77
+ "import": (() => import("@shikijs/langs/handlebars"))
78
+ },
79
+ {
80
+ "id": "html",
81
+ "name": "HTML",
82
+ "import": (() => import("@shikijs/langs/html"))
83
+ },
84
+ {
85
+ "id": "html-derivative",
86
+ "name": "HTML (Derivative)",
87
+ "import": (() => import("@shikijs/langs/html-derivative"))
88
+ },
89
+ {
90
+ "id": "http",
91
+ "name": "HTTP",
92
+ "import": (() => import("@shikijs/langs/http"))
93
+ },
94
+ {
95
+ "id": "hurl",
96
+ "name": "Hurl",
97
+ "import": (() => import("@shikijs/langs/hurl"))
98
+ },
99
+ {
100
+ "id": "imba",
101
+ "name": "Imba",
102
+ "import": (() => import("@shikijs/langs/imba"))
103
+ },
104
+ {
105
+ "id": "java",
106
+ "name": "Java",
107
+ "import": (() => import("@shikijs/langs/java"))
108
+ },
109
+ {
110
+ "id": "javascript",
111
+ "name": "JavaScript",
112
+ "aliases": [
113
+ "js",
114
+ "cjs",
115
+ "mjs"
116
+ ],
117
+ "import": (() => import("@shikijs/langs/javascript"))
118
+ },
119
+ {
120
+ "id": "jinja",
121
+ "name": "Jinja",
122
+ "import": (() => import("@shikijs/langs/jinja"))
123
+ },
124
+ {
125
+ "id": "jison",
126
+ "name": "Jison",
127
+ "import": (() => import("@shikijs/langs/jison"))
128
+ },
129
+ {
130
+ "id": "json",
131
+ "name": "JSON",
132
+ "import": (() => import("@shikijs/langs/json"))
133
+ },
134
+ {
135
+ "id": "json5",
136
+ "name": "JSON5",
137
+ "import": (() => import("@shikijs/langs/json5"))
138
+ },
139
+ {
140
+ "id": "jsonc",
141
+ "name": "JSON with Comments",
142
+ "import": (() => import("@shikijs/langs/jsonc"))
143
+ },
144
+ {
145
+ "id": "jsonl",
146
+ "name": "JSON Lines",
147
+ "import": (() => import("@shikijs/langs/jsonl"))
148
+ },
149
+ {
150
+ "id": "jsx",
151
+ "name": "JSX",
152
+ "import": (() => import("@shikijs/langs/jsx"))
153
+ },
154
+ {
155
+ "id": "julia",
156
+ "name": "Julia",
157
+ "aliases": ["jl"],
158
+ "import": (() => import("@shikijs/langs/julia"))
159
+ },
160
+ {
161
+ "id": "less",
162
+ "name": "Less",
163
+ "import": (() => import("@shikijs/langs/less"))
164
+ },
165
+ {
166
+ "id": "markdown",
167
+ "name": "Markdown",
168
+ "aliases": ["md"],
169
+ "import": (() => import("@shikijs/langs/markdown"))
170
+ },
171
+ {
172
+ "id": "marko",
173
+ "name": "Marko",
174
+ "import": (() => import("@shikijs/langs/marko"))
175
+ },
176
+ {
177
+ "id": "mdc",
178
+ "name": "MDC",
179
+ "import": (() => import("@shikijs/langs/mdc"))
180
+ },
181
+ {
182
+ "id": "mdx",
183
+ "name": "MDX",
184
+ "import": (() => import("@shikijs/langs/mdx"))
185
+ },
186
+ {
187
+ "id": "php",
188
+ "name": "PHP",
189
+ "import": (() => import("@shikijs/langs/php"))
190
+ },
191
+ {
192
+ "id": "postcss",
193
+ "name": "PostCSS",
194
+ "import": (() => import("@shikijs/langs/postcss"))
195
+ },
196
+ {
197
+ "id": "pug",
198
+ "name": "Pug",
199
+ "aliases": ["jade"],
200
+ "import": (() => import("@shikijs/langs/pug"))
201
+ },
202
+ {
203
+ "id": "python",
204
+ "name": "Python",
205
+ "aliases": ["py"],
206
+ "import": (() => import("@shikijs/langs/python"))
207
+ },
208
+ {
209
+ "id": "r",
210
+ "name": "R",
211
+ "import": (() => import("@shikijs/langs/r"))
212
+ },
213
+ {
214
+ "id": "regexp",
215
+ "name": "RegExp",
216
+ "aliases": ["regex"],
217
+ "import": (() => import("@shikijs/langs/regexp"))
218
+ },
219
+ {
220
+ "id": "sass",
221
+ "name": "Sass",
222
+ "import": (() => import("@shikijs/langs/sass"))
223
+ },
224
+ {
225
+ "id": "scss",
226
+ "name": "SCSS",
227
+ "import": (() => import("@shikijs/langs/scss"))
228
+ },
229
+ {
230
+ "id": "shellscript",
231
+ "name": "Shell",
232
+ "aliases": [
233
+ "bash",
234
+ "sh",
235
+ "shell",
236
+ "zsh"
237
+ ],
238
+ "import": (() => import("@shikijs/langs/shellscript"))
239
+ },
240
+ {
241
+ "id": "sql",
242
+ "name": "SQL",
243
+ "import": (() => import("@shikijs/langs/sql"))
244
+ },
245
+ {
246
+ "id": "stylus",
247
+ "name": "Stylus",
248
+ "aliases": ["styl"],
249
+ "import": (() => import("@shikijs/langs/stylus"))
250
+ },
251
+ {
252
+ "id": "svelte",
253
+ "name": "Svelte",
254
+ "import": (() => import("@shikijs/langs/svelte"))
255
+ },
256
+ {
257
+ "id": "ts-tags",
258
+ "name": "TypeScript with Tags",
259
+ "aliases": ["lit"],
260
+ "import": (() => import("@shikijs/langs/ts-tags"))
261
+ },
262
+ {
263
+ "id": "tsx",
264
+ "name": "TSX",
265
+ "import": (() => import("@shikijs/langs/tsx"))
266
+ },
267
+ {
268
+ "id": "typescript",
269
+ "name": "TypeScript",
270
+ "aliases": [
271
+ "ts",
272
+ "cts",
273
+ "mts"
274
+ ],
275
+ "import": (() => import("@shikijs/langs/typescript"))
276
+ },
277
+ {
278
+ "id": "vue",
279
+ "name": "Vue",
280
+ "import": (() => import("@shikijs/langs/vue"))
281
+ },
282
+ {
283
+ "id": "vue-html",
284
+ "name": "Vue HTML",
285
+ "import": (() => import("@shikijs/langs/vue-html"))
286
+ },
287
+ {
288
+ "id": "vue-vine",
289
+ "name": "Vue Vine",
290
+ "import": (() => import("@shikijs/langs/vue-vine"))
291
+ },
292
+ {
293
+ "id": "wasm",
294
+ "name": "WebAssembly",
295
+ "import": (() => import("@shikijs/langs/wasm"))
296
+ },
297
+ {
298
+ "id": "wgsl",
299
+ "name": "WGSL",
300
+ "import": (() => import("@shikijs/langs/wgsl"))
301
+ },
302
+ {
303
+ "id": "wit",
304
+ "name": "WebAssembly Interface Types",
305
+ "import": (() => import("@shikijs/langs/wit"))
306
+ },
307
+ {
308
+ "id": "xml",
309
+ "name": "XML",
310
+ "import": (() => import("@shikijs/langs/xml"))
311
+ },
312
+ {
313
+ "id": "yaml",
314
+ "name": "YAML",
315
+ "aliases": ["yml"],
316
+ "import": (() => import("@shikijs/langs/yaml"))
317
+ }
340
318
  ];
341
319
  const bundledLanguagesBase = Object.fromEntries(bundledLanguagesInfo.map((i) => [i.id, i.import]));
342
320
  const bundledLanguagesAlias = Object.fromEntries(bundledLanguagesInfo.flatMap((i) => i.aliases?.map((a) => [a, i.import]) || []));
343
321
  const bundledLanguages = {
344
- ...bundledLanguagesBase,
345
- ...bundledLanguagesAlias
322
+ ...bundledLanguagesBase,
323
+ ...bundledLanguagesAlias
346
324
  };
347
325
 
326
+ //#endregion
327
+ //#region src/bundle-web.ts
328
+ var bundle_web_exports = /* @__PURE__ */ __exportAll({
329
+ bundledLanguages: () => bundledLanguages,
330
+ bundledLanguagesAlias: () => bundledLanguagesAlias,
331
+ bundledLanguagesBase: () => bundledLanguagesBase,
332
+ bundledLanguagesInfo: () => bundledLanguagesInfo,
333
+ bundledThemes: () => bundledThemes,
334
+ bundledThemesInfo: () => bundledThemesInfo,
335
+ codeToHast: () => codeToHast,
336
+ codeToHtml: () => codeToHtml,
337
+ codeToTokens: () => codeToTokens,
338
+ codeToTokensBase: () => codeToTokensBase,
339
+ codeToTokensWithThemes: () => codeToTokensWithThemes,
340
+ createHighlighter: () => createHighlighter,
341
+ getLastGrammarState: () => getLastGrammarState,
342
+ getSingletonHighlighter: () => getSingletonHighlighter
343
+ });
344
+ /**
345
+ * Initiate a highlighter instance and load the specified languages and themes.
346
+ * Later it can be used synchronously to highlight code.
347
+ *
348
+ * Importing this function will bundle all languages and themes.
349
+ * @see https://shiki.style/guide/bundles#shiki-bundle-web
350
+ *
351
+ * For granular control over the bundle, check:
352
+ * @see https://shiki.style/guide/bundles#fine-grained-bundle
353
+ */
348
354
  const createHighlighter = /* @__PURE__ */ createBundledHighlighter({
349
- langs: bundledLanguages,
350
- themes: bundledThemes,
351
- engine: () => createOnigurumaEngine(import('shiki/wasm'))
355
+ langs: bundledLanguages,
356
+ themes: bundledThemes,
357
+ engine: () => (0, engine_oniguruma_exports.createOnigurumaEngine)(import("shiki/wasm"))
352
358
  });
353
- const {
354
- codeToHtml,
355
- codeToHast,
356
- codeToTokensBase,
357
- codeToTokens,
358
- codeToTokensWithThemes,
359
- getSingletonHighlighter,
360
- getLastGrammarState
361
- } = /* @__PURE__ */ createSingletonShorthands(
362
- createHighlighter,
363
- { guessEmbeddedLanguages }
364
- );
359
+ const { codeToHtml, codeToHast, codeToTokensBase, codeToTokens, codeToTokensWithThemes, getSingletonHighlighter, getLastGrammarState } = /* @__PURE__ */ createSingletonShorthands(createHighlighter, { guessEmbeddedLanguages });
365
360
 
366
- export { bundledLanguages, bundledLanguagesAlias, bundledLanguagesBase, bundledLanguagesInfo, bundledThemes, codeToHast, codeToHtml, codeToTokens, codeToTokensBase, codeToTokensWithThemes, createHighlighter, getLastGrammarState, getSingletonHighlighter };
361
+ //#endregion
362
+ export { bundledLanguages, bundledLanguagesAlias, bundledLanguagesBase, bundledLanguagesInfo, bundledThemes, bundledThemesInfo, codeToHast, codeToHtml, codeToTokens, codeToTokensBase, codeToTokensWithThemes, createHighlighter, getLastGrammarState, getSingletonHighlighter };