Skip to content

Commit c056371

Browse files
committed
chore: update snapshot
1 parent 6f6e99e commit c056371

File tree

21 files changed

+368
-25
lines changed

21 files changed

+368
-25
lines changed

packages/codegen/test/__snapshots__/basic-oniguruma-js.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,12 @@ import { createOnigurumaEngine } from '@shikijs/engine-oniguruma'
88
const bundledLanguages = {
99
javascript: () => import('@shikijs/langs/javascript'),
1010
js: () => import('@shikijs/langs/javascript'),
11+
cjs: () => import('@shikijs/langs/javascript'),
12+
mjs: () => import('@shikijs/langs/javascript'),
1113
typescript: () => import('@shikijs/langs/typescript'),
1214
ts: () => import('@shikijs/langs/typescript'),
15+
cts: () => import('@shikijs/langs/typescript'),
16+
mts: () => import('@shikijs/langs/typescript'),
1317
tsx: () => import('@shikijs/langs/tsx'),
1418
}
1519

packages/codegen/test/__snapshots__/basic-oniguruma.ts

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,15 +10,28 @@ import {
1010
} from '@shikijs/core'
1111
import { createOnigurumaEngine } from '@shikijs/engine-oniguruma'
1212

13-
type BundledLanguage = 'javascript' | 'js' | 'typescript' | 'ts' | 'tsx'
13+
type BundledLanguage =
14+
| 'javascript'
15+
| 'js'
16+
| 'cjs'
17+
| 'mjs'
18+
| 'typescript'
19+
| 'ts'
20+
| 'cts'
21+
| 'mts'
22+
| 'tsx'
1423
type BundledTheme = 'nord' | 'vitesse-dark'
1524
type Highlighter = HighlighterGeneric<BundledLanguage, BundledTheme>
1625

1726
const bundledLanguages = {
1827
javascript: () => import('@shikijs/langs/javascript'),
1928
js: () => import('@shikijs/langs/javascript'),
29+
cjs: () => import('@shikijs/langs/javascript'),
30+
mjs: () => import('@shikijs/langs/javascript'),
2031
typescript: () => import('@shikijs/langs/typescript'),
2132
ts: () => import('@shikijs/langs/typescript'),
33+
cts: () => import('@shikijs/langs/typescript'),
34+
mts: () => import('@shikijs/langs/typescript'),
2235
tsx: () => import('@shikijs/langs/tsx'),
2336
} as Record<BundledLanguage, DynamicImportLanguageRegistration>
2437

packages/codegen/test/__snapshots__/basic-precompiled.ts

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,28 @@ import type {
77
import { createdBundledHighlighter } from '@shikijs/core'
88
import { createJavaScriptRawEngine } from '@shikijs/engine-javascript/raw'
99

10-
type BundledLanguage = 'javascript' | 'js' | 'typescript' | 'ts' | 'tsx'
10+
type BundledLanguage =
11+
| 'javascript'
12+
| 'js'
13+
| 'cjs'
14+
| 'mjs'
15+
| 'typescript'
16+
| 'ts'
17+
| 'cts'
18+
| 'mts'
19+
| 'tsx'
1120
type BundledTheme = 'nord' | 'vitesse-dark'
1221
type Highlighter = HighlighterGeneric<BundledLanguage, BundledTheme>
1322

1423
const bundledLanguages = {
1524
javascript: () => import('@shikijs/langs-precompiled/javascript'),
1625
js: () => import('@shikijs/langs-precompiled/javascript'),
26+
cjs: () => import('@shikijs/langs-precompiled/javascript'),
27+
mjs: () => import('@shikijs/langs-precompiled/javascript'),
1728
typescript: () => import('@shikijs/langs-precompiled/typescript'),
1829
ts: () => import('@shikijs/langs-precompiled/typescript'),
30+
cts: () => import('@shikijs/langs-precompiled/typescript'),
31+
mts: () => import('@shikijs/langs-precompiled/typescript'),
1932
tsx: () => import('@shikijs/langs-precompiled/tsx'),
2033
} as Record<BundledLanguage, DynamicImportLanguageRegistration>
2134

packages/core/src/constructors/bundle-factory.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ import { createHighlighterCore } from './highlighter'
4646
* @param options
4747
*/
4848
export function createdBundledHighlighter<BundledLangs extends string, BundledThemes extends string>(
49-
options: CreatedBundledHighlighterOptions<BundledLangs, BundledThemes>
49+
options: CreatedBundledHighlighterOptions<BundledLangs, BundledThemes>,
5050
): CreateHighlighterFactory<BundledLangs, BundledThemes>
5151

5252
// Implementation

packages/core/src/highlight/code-to-tokens-base.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,12 +62,12 @@ export function codeToTokensBase(
6262

6363
export function getLastGrammarState(
6464
internal: ShikiInternal,
65-
element: ThemedToken[][] | Root
65+
element: ThemedToken[][] | Root,
6666
): GrammarState | undefined
6767
export function getLastGrammarState(
6868
internal: ShikiInternal,
6969
code: string,
70-
options?: CodeToTokensBaseOptions
70+
options?: CodeToTokensBaseOptions,
7171
): GrammarState
7272
export function getLastGrammarState(...args: any[]): GrammarState | undefined {
7373
if (args.length === 2) {

packages/core/src/highlight/code-to-tokens-themes.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -70,9 +70,9 @@ export function codeToTokensWithThemes(
7070

7171
const mergedGrammarState = themedTokens[0].state
7272
? new GrammarState(
73-
Object.fromEntries(themedTokens.map(s => [s.theme, s.state?.getInternalStack(s.theme)])),
74-
themedTokens[0].state.lang,
75-
)
73+
Object.fromEntries(themedTokens.map(s => [s.theme, s.state?.getInternalStack(s.theme)])),
74+
themedTokens[0].state.lang,
75+
)
7676
: undefined
7777
if (mergedGrammarState)
7878
setLastGrammarStateToMap(mergedTokens, mergedGrammarState)

packages/core/test/core-sync.test.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,8 @@ describe('should', () => {
3939
"c",
4040
"python",
4141
"js",
42+
"cjs",
43+
"mjs",
4244
"py",
4345
]
4446
`)

packages/core/test/core.test.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,8 @@ describe('should', () => {
4646
"c",
4747
"python",
4848
"js",
49+
"cjs",
50+
"mjs",
4951
"py",
5052
]
5153
`)

packages/core/test/injections.test.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,8 @@ it('injections-side-effects angular-html', async () => {
9393
"css",
9494
"html",
9595
"js",
96+
"cjs",
97+
"mjs",
9698
]
9799
`)
98100

@@ -114,6 +116,8 @@ it('injections-side-effects angular-html', async () => {
114116
"angular-template-blocks",
115117
"angular-html",
116118
"js",
119+
"cjs",
120+
"mjs",
117121
]
118122
`)
119123

packages/engine-javascript/test/__records__/beancount.js.json

Lines changed: 148 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,43 @@
7272
]
7373
}
7474
},
75+
{
76+
"id": "IentyorrphP8rrlrFSerMkxFsXnvFuvILOkxjpC9pBk",
77+
"patterns": [
78+
"txn|\\*",
79+
"!",
80+
"P"
81+
],
82+
"args": [
83+
"2012-11-03 *",
84+
11,
85+
0
86+
],
87+
"result": {
88+
"index": 0,
89+
"captureIndices": [
90+
{
91+
"start": 11,
92+
"end": 12,
93+
"length": 1
94+
}
95+
]
96+
}
97+
},
98+
{
99+
"id": "IentyorrphP8rrlrFSerMkxFsXnvFuvILOkxjpC9pBk",
100+
"patterns": [
101+
"txn|\\*",
102+
"!",
103+
"P"
104+
],
105+
"args": [
106+
"2012-11-03 *",
107+
12,
108+
0
109+
],
110+
"result": null
111+
},
75112
{
76113
"id": "4yEMQMVPA8RMIwd1wyJN6gwp7C-rVlEQB1v6lKjxWCA",
77114
"patterns": [
@@ -739,6 +776,43 @@
739776
]
740777
}
741778
},
779+
{
780+
"id": "IentyorrphP8rrlrFSerMkxFsXnvFuvILOkxjpC9pBk",
781+
"patterns": [
782+
"txn|\\*",
783+
"!",
784+
"P"
785+
],
786+
"args": [
787+
"2012-11-03 *",
788+
11,
789+
0
790+
],
791+
"result": {
792+
"index": 0,
793+
"captureIndices": [
794+
{
795+
"start": 11,
796+
"end": 12,
797+
"length": 1
798+
}
799+
]
800+
}
801+
},
802+
{
803+
"id": "IentyorrphP8rrlrFSerMkxFsXnvFuvILOkxjpC9pBk",
804+
"patterns": [
805+
"txn|\\*",
806+
"!",
807+
"P"
808+
],
809+
"args": [
810+
"2012-11-03 *",
811+
12,
812+
0
813+
],
814+
"result": null
815+
},
742816
{
743817
"id": "4yEMQMVPA8RMIwd1wyJN6gwp7C-rVlEQB1v6lKjxWCA",
744818
"patterns": [
@@ -1559,6 +1633,43 @@
15591633
]
15601634
}
15611635
},
1636+
{
1637+
"id": "IentyorrphP8rrlrFSerMkxFsXnvFuvILOkxjpC9pBk",
1638+
"patterns": [
1639+
"txn|\\*",
1640+
"!",
1641+
"P"
1642+
],
1643+
"args": [
1644+
"2012-11-03 *",
1645+
11,
1646+
0
1647+
],
1648+
"result": {
1649+
"index": 0,
1650+
"captureIndices": [
1651+
{
1652+
"start": 11,
1653+
"end": 12,
1654+
"length": 1
1655+
}
1656+
]
1657+
}
1658+
},
1659+
{
1660+
"id": "IentyorrphP8rrlrFSerMkxFsXnvFuvILOkxjpC9pBk",
1661+
"patterns": [
1662+
"txn|\\*",
1663+
"!",
1664+
"P"
1665+
],
1666+
"args": [
1667+
"2012-11-03 *",
1668+
12,
1669+
0
1670+
],
1671+
"result": null
1672+
},
15621673
{
15631674
"id": "4yEMQMVPA8RMIwd1wyJN6gwp7C-rVlEQB1v6lKjxWCA",
15641675
"patterns": [
@@ -2226,6 +2337,43 @@
22262337
]
22272338
}
22282339
},
2340+
{
2341+
"id": "IentyorrphP8rrlrFSerMkxFsXnvFuvILOkxjpC9pBk",
2342+
"patterns": [
2343+
"txn|\\*",
2344+
"!",
2345+
"P"
2346+
],
2347+
"args": [
2348+
"2012-11-03 *",
2349+
11,
2350+
0
2351+
],
2352+
"result": {
2353+
"index": 0,
2354+
"captureIndices": [
2355+
{
2356+
"start": 11,
2357+
"end": 12,
2358+
"length": 1
2359+
}
2360+
]
2361+
}
2362+
},
2363+
{
2364+
"id": "IentyorrphP8rrlrFSerMkxFsXnvFuvILOkxjpC9pBk",
2365+
"patterns": [
2366+
"txn|\\*",
2367+
"!",
2368+
"P"
2369+
],
2370+
"args": [
2371+
"2012-11-03 *",
2372+
12,
2373+
0
2374+
],
2375+
"result": null
2376+
},
22292377
{
22302378
"id": "4yEMQMVPA8RMIwd1wyJN6gwp7C-rVlEQB1v6lKjxWCA",
22312379
"patterns": [

0 commit comments

Comments
 (0)