Skip to content

Commit

Permalink
feat: update deps and themes, close #810
Browse files Browse the repository at this point in the history
  • Loading branch information
antfu committed Oct 24, 2024
1 parent b8471aa commit 2b51398
Show file tree
Hide file tree
Showing 5 changed files with 876 additions and 780 deletions.
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"type": "module",
"version": "1.22.0",
"private": true,
"packageManager": "pnpm@9.11.0",
"packageManager": "pnpm@9.12.2",
"scripts": {
"lint": "eslint . --cache",
"release": "bumpp",
Expand Down Expand Up @@ -37,7 +37,7 @@
"@vitest/coverage-v8": "catalog:",
"ansi-sequence-parser": "catalog:",
"bumpp": "catalog:",
"diff-match-patch-es": "^0.1.0",
"diff-match-patch-es": "^0.1.1",
"eslint": "catalog:",
"eslint-plugin-format": "catalog:",
"esno": "catalog:",
Expand Down
12 changes: 6 additions & 6 deletions packages/shiki/scripts/prepare/langs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -95,18 +95,18 @@ export async function prepareLangs() {
if (deps.length > 10)
console.log(json.name, json.embeddedLangs)

const depsStr = [
...deps.map(i => `...${i.replace(/\W/g, '_')}`),
'lang',
].join(',\n') || ''

await fs.writeFile(
`./src/langs/${lang.name}.mjs`,
`${deps.map(i => `import ${i.replace(/\W/g, '_')} from './${i}.mjs'`).join('\n')}
const lang = Object.freeze(JSON.parse(${JSON.stringify(JSON.stringify(json))}))
export default [
${[
...deps.map(i => ` ...${i.replace(/\W/g, '_')}`),
' lang',
].join(',\n') || ''}
]
export default [\n${depsStr}\n]
`.replace(/\n{2,}/g, '\n\n').trimStart(),
'utf-8',
)
Expand Down
21 changes: 21 additions & 0 deletions packages/shiki/src/themes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,24 @@ export const bundledThemesInfo: BundledThemeInfo[] = [
"type": "dark",
"import": (() => import('./themes/houston.mjs')) as unknown as DynamicImportThemeRegistration
},
{
"id": "kanagawa-dragon",
"displayName": "Kanagawa Dragon",
"type": "dark",
"import": (() => import('./themes/kanagawa-dragon.mjs')) as unknown as DynamicImportThemeRegistration
},
{
"id": "kanagawa-lotus",
"displayName": "Kanagawa Lotus",
"type": "light",
"import": (() => import('./themes/kanagawa-lotus.mjs')) as unknown as DynamicImportThemeRegistration
},
{
"id": "kanagawa-wave",
"displayName": "Kanagawa Wave",
"type": "dark",
"import": (() => import('./themes/kanagawa-wave.mjs')) as unknown as DynamicImportThemeRegistration
},
{
"id": "laserwave",
"displayName": "LaserWave",
Expand Down Expand Up @@ -331,6 +349,9 @@ export type BundledTheme =
| 'github-light-default'
| 'github-light-high-contrast'
| 'houston'
| 'kanagawa-dragon'
| 'kanagawa-lotus'
| 'kanagawa-wave'
| 'laserwave'
| 'light-plus'
| 'material-theme'
Expand Down
Loading

0 comments on commit 2b51398

Please sign in to comment.