mirror of
https://github.com/d0zingcat/BroadcastChannel.git
synced 2026-05-14 07:26:50 +00:00
feat: enhance build and syntax highlighting
- Updated .gitignore to include new deployment and build tools - Added @types/prismjs for improved TypeScript support in syntax highlighting - Integrated PrismJS with additional languages for comprehensive code highlighting
This commit is contained in:
4
.gitignore
vendored
4
.gitignore
vendored
@@ -23,6 +23,6 @@ pnpm-debug.log*
|
||||
# jetbrains setting folder
|
||||
.idea/
|
||||
|
||||
.vercel/
|
||||
.netlify/
|
||||
.vercel
|
||||
.netlify
|
||||
.wrangler
|
||||
|
||||
@@ -33,6 +33,7 @@
|
||||
"@astrojs/netlify": "^5.4.0",
|
||||
"@astrojs/node": "^8.3.2",
|
||||
"@astrojs/vercel": "^7.7.2",
|
||||
"@types/prismjs": "^1.26.4",
|
||||
"astro-eslint-parser": "^1.0.2",
|
||||
"autoprefixer": "^10.4.20",
|
||||
"cssnano": "^7.0.4",
|
||||
|
||||
8
pnpm-lock.yaml
generated
8
pnpm-lock.yaml
generated
@@ -57,6 +57,9 @@ importers:
|
||||
'@astrojs/vercel':
|
||||
specifier: ^7.7.2
|
||||
version: 7.7.2(astro@4.12.3(@types/node@22.0.0)(typescript@5.5.4))
|
||||
'@types/prismjs':
|
||||
specifier: ^1.26.4
|
||||
version: 1.26.4
|
||||
astro-eslint-parser:
|
||||
specifier: ^1.0.2
|
||||
version: 1.0.2(typescript@5.5.4)
|
||||
@@ -1653,6 +1656,9 @@ packages:
|
||||
'@types/pg@8.6.1':
|
||||
resolution: {integrity: sha1-CZRQuNyXfoGXpE9SKc7e+VyHR/k=}
|
||||
|
||||
'@types/prismjs@1.26.4':
|
||||
resolution: {integrity: sha512-rlAnzkW2sZOjbqZ743IHUhFcvzaGbqijwOu8QZnZCjfQzBqFE3s4lOTJEsxikImav9uzz/42I+O7YUs1mWgMlg==}
|
||||
|
||||
'@types/shimmer@1.2.0':
|
||||
resolution: {integrity: sha512-UE7oxhQLLd9gub6JKIAhDq06T0F6FnztwMNRvYgjeQSBeMc1ZG/tA47EwfduvkuQS8apbkM/lpLpWsaCeYsXVg==}
|
||||
|
||||
@@ -6256,6 +6262,8 @@ snapshots:
|
||||
pg-protocol: 1.6.1
|
||||
pg-types: 2.2.0
|
||||
|
||||
'@types/prismjs@1.26.4': {}
|
||||
|
||||
'@types/shimmer@1.2.0': {}
|
||||
|
||||
'@types/unist@2.0.10': {}
|
||||
|
||||
29
src/lib/prism.js
Normal file
29
src/lib/prism.js
Normal file
@@ -0,0 +1,29 @@
|
||||
import prism from 'prismjs'
|
||||
|
||||
import 'prismjs/components/prism-c'
|
||||
import 'prismjs/components/prism-clojure'
|
||||
import 'prismjs/components/prism-cpp'
|
||||
import 'prismjs/components/prism-csharp'
|
||||
import 'prismjs/components/prism-css'
|
||||
import 'prismjs/components/prism-dart'
|
||||
import 'prismjs/components/prism-docker'
|
||||
import 'prismjs/components/prism-elixir'
|
||||
import 'prismjs/components/prism-go'
|
||||
import 'prismjs/components/prism-markup'
|
||||
import 'prismjs/components/prism-java'
|
||||
import 'prismjs/components/prism-javascript'
|
||||
import 'prismjs/components/prism-json'
|
||||
import 'prismjs/components/prism-julia'
|
||||
import 'prismjs/components/prism-kotlin'
|
||||
import 'prismjs/components/prism-lua'
|
||||
import 'prismjs/components/prism-markdown'
|
||||
import 'prismjs/components/prism-pascal'
|
||||
import 'prismjs/components/prism-php'
|
||||
import 'prismjs/components/prism-python'
|
||||
import 'prismjs/components/prism-ruby'
|
||||
import 'prismjs/components/prism-rust'
|
||||
import 'prismjs/components/prism-sql'
|
||||
import 'prismjs/components/prism-typescript'
|
||||
import 'prismjs/components/prism-yaml'
|
||||
|
||||
export default prism
|
||||
@@ -1,13 +1,10 @@
|
||||
import { $fetch } from 'ofetch'
|
||||
import * as cheerio from 'cheerio'
|
||||
import { LRUCache } from 'lru-cache'
|
||||
import prism from 'prismjs'
|
||||
import loadLanguages from 'prismjs/components/'
|
||||
import flourite from 'flourite'
|
||||
import prism from '../prism'
|
||||
import { getEnv } from '../env'
|
||||
|
||||
loadLanguages(['c', 'clojure', 'cpp', 'cs', 'css', 'dart', 'dockerfile', 'elixir', 'go', 'html', 'java', 'javascript', 'json', 'julia', 'kotlin', 'lua', 'markdown', 'pascal', 'php', 'python', 'ruby', 'rust', 'sql', 'typescript', 'yaml'])
|
||||
|
||||
const cache = new LRUCache({
|
||||
ttl: 1000 * 60 * 5, // 5 minutes
|
||||
maxSize: 50 * 1024 * 1024, // 50MB
|
||||
|
||||
Reference in New Issue
Block a user