@devframes/service-shiki 0.9.12 → 0.9.15
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/index.d.mts +11 -11
- package/dist/index.mjs +1 -1
- package/package.json +6 -6
package/dist/index.d.mts
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import { DevframeServiceDefinition } from "devframe/types";
|
|
2
2
|
import { codeToHast, codeToTokens } from "shiki";
|
|
3
3
|
//#region src/index.d.ts
|
|
4
|
-
declare const SHIKI_SERVICE_PACKAGE = "@devframes/service-shiki";
|
|
5
|
-
declare const SHIKI_SERVICE_SCOPE = "devframes:service:shiki";
|
|
4
|
+
export declare const SHIKI_SERVICE_PACKAGE = "@devframes/service-shiki";
|
|
5
|
+
export declare const SHIKI_SERVICE_SCOPE = "devframes:service:shiki";
|
|
6
6
|
/** Dual light/dark theme pair, rendered via Shiki's dual-theme CSS variables. */
|
|
7
|
-
interface ShikiThemes {
|
|
7
|
+
export interface ShikiThemes {
|
|
8
8
|
light: string;
|
|
9
9
|
dark: string;
|
|
10
10
|
}
|
|
11
11
|
/** Defaults matching the `@antfu/design` light/dark surfaces. */
|
|
12
|
-
declare const SHIKI_DEFAULT_THEMES: ShikiThemes;
|
|
13
|
-
interface ShikiServiceOptions {
|
|
12
|
+
export declare const SHIKI_DEFAULT_THEMES: ShikiThemes;
|
|
13
|
+
export interface ShikiServiceOptions {
|
|
14
14
|
/**
|
|
15
15
|
* Theme pair every request uses unless it carries its own. On merge, the
|
|
16
16
|
* later installer's pair wins.
|
|
@@ -22,16 +22,16 @@ interface ShikiServiceOptions {
|
|
|
22
22
|
*/
|
|
23
23
|
langs?: string[];
|
|
24
24
|
}
|
|
25
|
-
interface ShikiHighlightInput {
|
|
25
|
+
export interface ShikiHighlightInput {
|
|
26
26
|
code: string;
|
|
27
27
|
/** Language id; unknown ids degrade to plain text instead of throwing. */
|
|
28
28
|
lang?: string;
|
|
29
29
|
/** Per-request theme override. */
|
|
30
30
|
themes?: ShikiThemes;
|
|
31
31
|
}
|
|
32
|
-
type ShikiHast = Awaited<ReturnType<typeof codeToHast>>;
|
|
33
|
-
type ShikiTokens = Awaited<ReturnType<typeof codeToTokens>>;
|
|
34
|
-
interface ShikiServiceApi {
|
|
32
|
+
export type ShikiHast = Awaited<ReturnType<typeof codeToHast>>;
|
|
33
|
+
export type ShikiTokens = Awaited<ReturnType<typeof codeToTokens>>;
|
|
34
|
+
export interface ShikiServiceApi {
|
|
35
35
|
/** Highlight to HTML (dual-theme: light values inline, dark via `--shiki-dark` vars). */
|
|
36
36
|
highlight: (input: ShikiHighlightInput) => Promise<{
|
|
37
37
|
html: string;
|
|
@@ -63,6 +63,6 @@ declare module 'devframe' {
|
|
|
63
63
|
* `(code, lang, themes)` and every RPC function is `cacheable` on the client
|
|
64
64
|
* side too.
|
|
65
65
|
*/
|
|
66
|
-
declare function createShikiService(options?: ShikiServiceOptions): DevframeServiceDefinition<ShikiServiceApi, ShikiServiceOptions>;
|
|
66
|
+
export declare function createShikiService(options?: ShikiServiceOptions): DevframeServiceDefinition<ShikiServiceApi, ShikiServiceOptions>;
|
|
67
67
|
//#endregion
|
|
68
|
-
export {
|
|
68
|
+
export { createShikiService as default };
|
package/dist/index.mjs
CHANGED
|
@@ -2,7 +2,7 @@ import { defineRpcFunction } from "devframe";
|
|
|
2
2
|
import { hash } from "devframe/utils/hash";
|
|
3
3
|
import { s } from "devframe/utils/simple-schema";
|
|
4
4
|
//#region package.json
|
|
5
|
-
var version = "0.9.
|
|
5
|
+
var version = "0.9.15";
|
|
6
6
|
//#endregion
|
|
7
7
|
//#region src/index.ts
|
|
8
8
|
const SHIKI_SERVICE_PACKAGE = "@devframes/service-shiki";
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@devframes/service-shiki",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.9.
|
|
4
|
+
"version": "0.9.15",
|
|
5
5
|
"description": "Devframe wire service that renders Shiki syntax highlighting on the server, so plugins stop re-bundling highlighters.",
|
|
6
6
|
"author": "Anthony Fu <anthonyfu117@hotmail.com>",
|
|
7
7
|
"license": "MIT",
|
|
@@ -29,16 +29,16 @@
|
|
|
29
29
|
"dist"
|
|
30
30
|
],
|
|
31
31
|
"peerDependencies": {
|
|
32
|
-
"devframe": "0.9.
|
|
32
|
+
"devframe": "0.9.15"
|
|
33
33
|
},
|
|
34
34
|
"dependencies": {
|
|
35
35
|
"shiki": "^4.4.3"
|
|
36
36
|
},
|
|
37
37
|
"devDependencies": {
|
|
38
|
-
"@types/node": "^26.
|
|
39
|
-
"devframe": "0.9.
|
|
40
|
-
"tsdown": "^0.
|
|
41
|
-
"vitest": "^
|
|
38
|
+
"@types/node": "^26.5.0",
|
|
39
|
+
"devframe": "0.9.15",
|
|
40
|
+
"tsdown": "^0.23.0",
|
|
41
|
+
"vitest": "^5.0.0"
|
|
42
42
|
},
|
|
43
43
|
"scripts": {
|
|
44
44
|
"build": "tsdown",
|