Skip to content

Commit 2b51398

Browse files
committed
feat: update deps and themes, close #810
1 parent b8471aa commit 2b51398

File tree

5 files changed

+876
-780
lines changed

5 files changed

+876
-780
lines changed

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"type": "module",
33
"version": "1.22.0",
44
"private": true,
5-
"packageManager": "pnpm@9.11.0",
5+
"packageManager": "pnpm@9.12.2",
66
"scripts": {
77
"lint": "eslint . --cache",
88
"release": "bumpp",
@@ -37,7 +37,7 @@
3737
"@vitest/coverage-v8": "catalog:",
3838
"ansi-sequence-parser": "catalog:",
3939
"bumpp": "catalog:",
40-
"diff-match-patch-es": "^0.1.0",
40+
"diff-match-patch-es": "^0.1.1",
4141
"eslint": "catalog:",
4242
"eslint-plugin-format": "catalog:",
4343
"esno": "catalog:",

packages/shiki/scripts/prepare/langs.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -95,18 +95,18 @@ export async function prepareLangs() {
9595
if (deps.length > 10)
9696
console.log(json.name, json.embeddedLangs)
9797

98+
const depsStr = [
99+
...deps.map(i => `...${i.replace(/\W/g, '_')}`),
100+
'lang',
101+
].join(',\n') || ''
102+
98103
await fs.writeFile(
99104
`./src/langs/${lang.name}.mjs`,
100105
`${deps.map(i => `import ${i.replace(/\W/g, '_')} from './${i}.mjs'`).join('\n')}
101106
102107
const lang = Object.freeze(JSON.parse(${JSON.stringify(JSON.stringify(json))}))
103108
104-
export default [
105-
${[
106-
...deps.map(i => ` ...${i.replace(/\W/g, '_')}`),
107-
' lang',
108-
].join(',\n') || ''}
109-
]
109+
export default [\n${depsStr}\n]
110110
`.replace(/\n{2,}/g, '\n\n').trimStart(),
111111
'utf-8',
112112
)

packages/shiki/src/themes.ts

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,24 @@ export const bundledThemesInfo: BundledThemeInfo[] = [
122122
"type": "dark",
123123
"import": (() => import('./themes/houston.mjs')) as unknown as DynamicImportThemeRegistration
124124
},
125+
{
126+
"id": "kanagawa-dragon",
127+
"displayName": "Kanagawa Dragon",
128+
"type": "dark",
129+
"import": (() => import('./themes/kanagawa-dragon.mjs')) as unknown as DynamicImportThemeRegistration
130+
},
131+
{
132+
"id": "kanagawa-lotus",
133+
"displayName": "Kanagawa Lotus",
134+
"type": "light",
135+
"import": (() => import('./themes/kanagawa-lotus.mjs')) as unknown as DynamicImportThemeRegistration
136+
},
137+
{
138+
"id": "kanagawa-wave",
139+
"displayName": "Kanagawa Wave",
140+
"type": "dark",
141+
"import": (() => import('./themes/kanagawa-wave.mjs')) as unknown as DynamicImportThemeRegistration
142+
},
125143
{
126144
"id": "laserwave",
127145
"displayName": "LaserWave",
@@ -331,6 +349,9 @@ export type BundledTheme =
331349
| 'github-light-default'
332350
| 'github-light-high-contrast'
333351
| 'houston'
352+
| 'kanagawa-dragon'
353+
| 'kanagawa-lotus'
354+
| 'kanagawa-wave'
334355
| 'laserwave'
335356
| 'light-plus'
336357
| 'material-theme'

0 commit comments

Comments
 (0)