@tiramisu-docs/kit 0.1.1 → 0.1.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/highlight.js CHANGED
@@ -1,9 +1,9 @@
1
1
  import { createHighlighter } from "shiki";
2
2
  import { tiramisuGrammar } from "./tiramisu-grammar.js";
3
- let highlighter = null;
4
- async function getHighlighter() {
5
- if (!highlighter) {
6
- highlighter = await createHighlighter({
3
+ let highlighterPromise = null;
4
+ function getHighlighter() {
5
+ if (!highlighterPromise) {
6
+ highlighterPromise = createHighlighter({
7
7
  themes: ["github-light", "github-dark"],
8
8
  langs: [
9
9
  "typescript",
@@ -22,7 +22,7 @@ async function getHighlighter() {
22
22
  ],
23
23
  });
24
24
  }
25
- return highlighter;
25
+ return highlighterPromise;
26
26
  }
27
27
  /**
28
28
  * Post-process compiled Svelte output to add syntax highlighting.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tiramisu-docs/kit",
3
- "version": "0.1.1",
3
+ "version": "0.1.3",
4
4
  "license": "Apache-2.0",
5
5
  "type": "module",
6
6
  "svelte": "src/index.ts",
package/src/highlight.ts CHANGED
@@ -1,11 +1,11 @@
1
1
  import { createHighlighter, type Highlighter } from "shiki"
2
2
  import { tiramisuGrammar } from "./tiramisu-grammar.js"
3
3
 
4
- let highlighter: Highlighter | null = null
4
+ let highlighterPromise: Promise<Highlighter> | null = null
5
5
 
6
- async function getHighlighter(): Promise<Highlighter> {
7
- if (!highlighter) {
8
- highlighter = await createHighlighter({
6
+ function getHighlighter(): Promise<Highlighter> {
7
+ if (!highlighterPromise) {
8
+ highlighterPromise = createHighlighter({
9
9
  themes: ["github-light", "github-dark"],
10
10
  langs: [
11
11
  "typescript",
@@ -24,7 +24,7 @@ async function getHighlighter(): Promise<Highlighter> {
24
24
  ],
25
25
  })
26
26
  }
27
- return highlighter
27
+ return highlighterPromise
28
28
  }
29
29
 
30
30
  /**