Skip to content
This repository has been archived by the owner on Feb 7, 2024. It is now read-only.

Commit

Permalink
chore: remove cleanup logic
Browse files Browse the repository at this point in the history
  • Loading branch information
antfu committed Dec 20, 2023
1 parent be0c901 commit 0f4f394
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 135 deletions.
64 changes: 0 additions & 64 deletions packages/shikiji/scripts/prepare/injections.ts

This file was deleted.

5 changes: 2 additions & 3 deletions packages/shikiji/scripts/prepare/langs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import { grammars, injections } from 'tm-grammars'
import fg from 'fast-glob'
import type { LanguageRegistration } from 'shikiji-core'
import { COMMENT_HEAD } from './constants'
import { cleanupLanguageReg } from './utils'

export async function prepareLangs() {
const allLangFiles = await fg('*.json', {
Expand All @@ -22,14 +21,14 @@ export async function prepareLangs() {
continue
}

const json: LanguageRegistration = cleanupLanguageReg({
const json: LanguageRegistration = {
...lang,
...content,
name: content.name || lang.name,
scopeName: content.scopeName || lang.scopeName,
displayName: lang.displayName,
embeddedLangs: lang.embedded,
})
}

// F# and Markdown has circular dependency
if (lang.name === 'fsharp' && json.embeddedLangs)
Expand Down
5 changes: 1 addition & 4 deletions packages/shikiji/scripts/prepare/themes.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,11 @@
import fs from 'fs-extra'
import { themes as allThemes } from 'tm-themes'
import { COMMENT_HEAD } from './constants'
import { cleanupThemeReg } from './utils'

export async function prepareTheme() {
const themes = await Promise.all(allThemes
.map(async (t) => {
const theme = cleanupThemeReg(
await fs.readJSON(`./node_modules/tm-themes/themes/${t.name}.json`),
)
const theme = await fs.readJSON(`./node_modules/tm-themes/themes/${t.name}.json`)

await fs.writeFile(
`./src/assets/themes/${t.name}.ts`,
Expand Down
64 changes: 0 additions & 64 deletions packages/shikiji/scripts/prepare/utils.ts

This file was deleted.

0 comments on commit 0f4f394

Please sign in to comment.