starlight-theme-nova 0.0.4 → 0.0.5
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/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "starlight-theme-nova",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.0.
|
|
4
|
+
"version": "0.0.5",
|
|
5
5
|
"description": "",
|
|
6
6
|
"author": "ocavue <ocavue@gmail.com>",
|
|
7
7
|
"license": "MIT",
|
|
@@ -26,8 +26,9 @@
|
|
|
26
26
|
"src"
|
|
27
27
|
],
|
|
28
28
|
"dependencies": {
|
|
29
|
-
"@shikijs/transformers": "^
|
|
30
|
-
"@shikijs/twoslash": "^
|
|
29
|
+
"@shikijs/transformers": "^3.2.1",
|
|
30
|
+
"@shikijs/twoslash": "^3.2.1",
|
|
31
|
+
"@shikijs/types": "^3.2.1",
|
|
31
32
|
"astro-theme-toggle": "^0.5.1",
|
|
32
33
|
"hast-util-is-element": "^3.0.0"
|
|
33
34
|
},
|
package/src/shiki-config.ts
CHANGED
|
@@ -4,23 +4,31 @@ import {
|
|
|
4
4
|
transformerNotationHighlight,
|
|
5
5
|
} from '@shikijs/transformers'
|
|
6
6
|
import { transformerTwoslash } from '@shikijs/twoslash'
|
|
7
|
+
import type { ShikiTransformer } from '@shikijs/types'
|
|
7
8
|
import type { ShikiConfig } from 'astro'
|
|
8
9
|
|
|
9
10
|
import { transformerCopyButton } from './shiki-transformer-copy-button'
|
|
10
11
|
|
|
11
12
|
export function createShikiConfig(options: { twoslash: boolean }): ShikiConfig {
|
|
13
|
+
const transformers: ShikiTransformer[] = [
|
|
14
|
+
transformerNotationDiff(),
|
|
15
|
+
transformerNotationHighlight(),
|
|
16
|
+
transformerMetaHighlight(),
|
|
17
|
+
transformerCopyButton(),
|
|
18
|
+
options.twoslash
|
|
19
|
+
? transformerTwoslash({
|
|
20
|
+
explicitTrigger: true,
|
|
21
|
+
})
|
|
22
|
+
: undefined,
|
|
23
|
+
].filter((x) => !!x)
|
|
24
|
+
|
|
12
25
|
return {
|
|
13
26
|
themes: {
|
|
14
27
|
light: 'one-light',
|
|
15
28
|
dark: 'github-dark-dimmed',
|
|
16
29
|
},
|
|
17
30
|
defaultColor: false,
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
transformerNotationHighlight(),
|
|
21
|
-
transformerMetaHighlight(),
|
|
22
|
-
transformerCopyButton(),
|
|
23
|
-
options.twoslash ? transformerTwoslash() : undefined,
|
|
24
|
-
].filter((x) => !!x),
|
|
31
|
+
// @ts-expect-error: Astro is using outdated Shiki v1
|
|
32
|
+
transformers: transformers,
|
|
25
33
|
}
|
|
26
34
|
}
|
|
@@ -1,8 +1,6 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { ShikiTransformer } from '@shikijs/types'
|
|
2
2
|
import { isElement } from 'hast-util-is-element'
|
|
3
3
|
|
|
4
|
-
type ShikiTransformer = NonNullable<ShikiConfig['transformers']>[number]
|
|
5
|
-
|
|
6
4
|
const name = 'starlight-theme-nova-shiki-transformer-copy-button'
|
|
7
5
|
|
|
8
6
|
/**
|