@ox-content/vite-plugin-svelte 2.66.0 → 2.68.0

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.cts CHANGED
@@ -2,30 +2,60 @@ import { PluginOption } from "vite";
2
2
  import { OxContentOptions, oxContent } from "@ox-content/vite-plugin";
3
3
 
4
4
  //#region src/types.d.ts
5
+ /**
6
+ * Code annotation options for the Svelte integration.
7
+ *
8
+ * The Svelte integration supports opt-in fence metadata and exposes the
9
+ * attribute key used by the Svelte markdown transform.
10
+ */
5
11
  interface CodeAnnotationsOptions {
12
+ /**
13
+ * Attribute name read from the code fence meta string.
14
+ *
15
+ * @default 'annotate'
16
+ */
6
17
  metaKey?: string;
7
18
  }
8
19
  interface ResolvedCodeAnnotationsOptions {
9
20
  enabled: boolean;
10
21
  metaKey: string;
11
22
  }
23
+ /**
24
+ * Map from Markdown component names to import paths.
25
+ */
12
26
  type ComponentsMap = Record<string, string>;
13
27
  /**
14
28
  * Component registration options.
29
+ *
15
30
  * Can be a map, a glob pattern, or an array of glob patterns.
31
+ * Globbed components are resolved relative to the Vite project root during
32
+ * `configResolved`.
16
33
  */
17
34
  type ComponentsOption = ComponentsMap | string | string[];
35
+ /**
36
+ * Svelte integration plugin options.
37
+ *
38
+ * This extends the core ox-content options with Svelte component registration
39
+ * and runtime mode controls. Markdown files are transformed into Svelte-aware
40
+ * modules while the core plugin provides shared parsing and embeds.
41
+ */
18
42
  interface SvelteIntegrationOptions extends OxContentOptions {
19
43
  /**
20
44
  * Markdown-like file extensions to process.
45
+ *
46
+ * Values are normalized with a leading dot before matching file paths.
47
+ *
21
48
  * @default ['.md', '.markdown', '.mdx']
22
49
  */
23
50
  extensions?: string[];
24
51
  /**
25
52
  * Components to register for use in Markdown.
53
+ *
26
54
  * Can be a map of names to paths, a glob pattern, or an array of globs.
27
55
  * When using glob patterns, component names are derived from file names.
28
56
  *
57
+ * @default {}
58
+ *
29
59
  * @example
30
60
  * ```ts
31
61
  * // Glob pattern (recommended)
@@ -36,25 +66,101 @@ interface SvelteIntegrationOptions extends OxContentOptions {
36
66
  * ```
37
67
  */
38
68
  components?: ComponentsOption;
69
+ /**
70
+ * Enable opt-in line annotations for fenced code blocks.
71
+ *
72
+ * Pass `true` to use the default `annotate` meta key, or an object to change it.
73
+ *
74
+ * @default false
75
+ */
39
76
  codeAnnotations?: boolean | CodeAnnotationsOptions;
77
+ /**
78
+ * Generate Svelte 5 runes-compatible runtime integration.
79
+ *
80
+ * Keep this enabled for Svelte 5 projects. Disable it only for compatibility
81
+ * with older runtime assumptions.
82
+ *
83
+ * @default true
84
+ */
40
85
  runes?: boolean;
86
+ /**
87
+ * Built-in static embeds rendered during Markdown transformation.
88
+ *
89
+ * Set to `false` to disable all built-in embeds.
90
+ * Configure individual fetch-related options under `github` and `openGraph`.
91
+ *
92
+ * @default { github: true, openGraph: true }
93
+ */
41
94
  embeds?: BuiltinEmbedOptions | false;
42
95
  }
96
+ /**
97
+ * Fetch options for Svelte GitHub embeds.
98
+ */
43
99
  interface GitHubEmbedOptions {
100
+ /**
101
+ * GitHub API token used for higher rate limits and private repository access.
102
+ * @default ''
103
+ */
44
104
  token?: string;
105
+ /**
106
+ * Cache fetched repository and source data in memory for the current process.
107
+ * @default true
108
+ */
45
109
  cache?: boolean;
110
+ /**
111
+ * Cache TTL in milliseconds.
112
+ * @default 3600000
113
+ */
46
114
  cacheTTL?: number;
115
+ /**
116
+ * Maximum source file size to inline in bytes.
117
+ * @default 200000
118
+ */
47
119
  maxSourceBytes?: number;
120
+ /**
121
+ * Maximum source lines to inline when no line range is specified.
122
+ * @default 120
123
+ */
48
124
  maxSourceLines?: number;
49
125
  }
126
+ /**
127
+ * Fetch options for Svelte Open Graph embeds.
128
+ */
50
129
  interface OpenGraphEmbedOptions {
130
+ /**
131
+ * Request timeout in milliseconds.
132
+ * @default 10000
133
+ */
51
134
  timeout?: number;
135
+ /**
136
+ * Cache fetched Open Graph metadata in memory for the current process.
137
+ * @default true
138
+ */
52
139
  cache?: boolean;
140
+ /**
141
+ * Cache TTL in milliseconds.
142
+ * @default 3600000
143
+ */
53
144
  cacheTTL?: number;
145
+ /**
146
+ * User agent sent with metadata fetch requests.
147
+ * @default 'ox-content-ogp-bot/1.0 (compatible; +https://github.com/ubugeeei-prod/ox-content)'
148
+ */
54
149
  userAgent?: string;
55
150
  }
151
+ /**
152
+ * Built-in embed options for the Svelte integration.
153
+ */
56
154
  interface BuiltinEmbedOptions {
155
+ /**
156
+ * Render `<GitHub repo="owner/name" />` repository cards.
157
+ * @default true
158
+ */
57
159
  github?: boolean | GitHubEmbedOptions;
160
+ /**
161
+ * Render `<OgCard url="https://example.com" />` Open Graph link cards.
162
+ * @default true
163
+ */
58
164
  openGraph?: boolean | OpenGraphEmbedOptions;
59
165
  }
60
166
  interface ResolvedBuiltinEmbedOptions {
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.cts","names":[],"sources":["../src/types.ts","../src/index.ts"],"mappings":";;;;UAEiB,sBAAA;EACf,OAAA;AAAA;AAAA,UAGe,8BAAA;EACf,OAAA;EACA,OAAA;AAAA;AAAA,KAGU,aAAA,GAAgB,MAAA;AAL5B;;;;AAAA,KAWY,gBAAA,GAAmB,aAAA;AAAA,UAEd,wBAAA,SAAiC,gBAAA;EARzB;;;;EAavB,UAAA;EAP0B;;;;AAE5B;;;;;;;;;;EAqBE,UAAA,GAAa,gBAAA;EACb,eAAA,aAA4B,sBAAA;EAC5B,KAAA;EACA,MAAA,GAAS,mBAAA;AAAA;AAAA,UAGM,kBAAA;EACf,KAAA;EACA,KAAA;EACA,QAAA;EACA,cAAA;EACA,cAAA;AAAA;AAAA,UAGe,qBAAA;EACf,OAAA;EACA,KAAA;EACA,QAAA;EACA,SAAA;AAAA;AAAA,UAGe,mBAAA;EACf,MAAA,aAAmB,kBAAA;EACnB,SAAA,aAAsB,qBAAA;AAAA;AAAA,UAGP,2BAAA;EACf,MAAA,EAAQ,kBAAA;EACR,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uEA;;;;EAjEA,KAAA;;AC5DF;;;EDkEE,QAAA;EClEuC;;;;EDwEvC,SAAA;AAAA;;;;UAMe,mBAAA;;;;;EAKf,MAAA,aAAmB,kBAAA;;;;;EAMnB,SAAA,aAAsB,qBAAA;AAAA;AAAA,UAGP,2BAAA;EACf,MAAA,EAAQ,kBAAA;EACR,SAAA,EAAW,qBAAA;AAAA;AAAA,UAGI,qBAAA;EACf,MAAA;EACA,MAAA;EACA,IAAA;EACA,UAAA;EACA,GAAA;EACA,WAAA;EACA,GAAA;EACA,WAAA;EACA,eAAA,EAAiB,8BAAA;EACjB,UAAA,EAAY,aAAA;EACZ,KAAA;EACA,MAAA,EAAQ,2BAAA;EACR,IAAA;AAAA;AAAA,UAGe,qBAAA;EACf,IAAA;EACA,GAAA;EACA,cAAA;EACA,WAAA,EAAa,MAAA;AAAA;AAAA,UAGE,eAAA;EACf,IAAA;EACA,KAAA,EAAO,MAAA;EACP,QAAA;EACA,EAAA;EACA,OAAA;AAAA;;;;AAvMF;;;;;AAQA;;;;;AASA;;;;;AASA;;;;;;;iBCgDgB,eAAA,CAAgB,OAAA,GAAS,wBAAA,GAAgC,YAAA"}
package/dist/index.d.mts CHANGED
@@ -2,30 +2,60 @@ import { OxContentOptions, oxContent } from "@ox-content/vite-plugin";
2
2
  import { PluginOption } from "vite";
3
3
 
4
4
  //#region src/types.d.ts
5
+ /**
6
+ * Code annotation options for the Svelte integration.
7
+ *
8
+ * The Svelte integration supports opt-in fence metadata and exposes the
9
+ * attribute key used by the Svelte markdown transform.
10
+ */
5
11
  interface CodeAnnotationsOptions {
12
+ /**
13
+ * Attribute name read from the code fence meta string.
14
+ *
15
+ * @default 'annotate'
16
+ */
6
17
  metaKey?: string;
7
18
  }
8
19
  interface ResolvedCodeAnnotationsOptions {
9
20
  enabled: boolean;
10
21
  metaKey: string;
11
22
  }
23
+ /**
24
+ * Map from Markdown component names to import paths.
25
+ */
12
26
  type ComponentsMap = Record<string, string>;
13
27
  /**
14
28
  * Component registration options.
29
+ *
15
30
  * Can be a map, a glob pattern, or an array of glob patterns.
31
+ * Globbed components are resolved relative to the Vite project root during
32
+ * `configResolved`.
16
33
  */
17
34
  type ComponentsOption = ComponentsMap | string | string[];
35
+ /**
36
+ * Svelte integration plugin options.
37
+ *
38
+ * This extends the core ox-content options with Svelte component registration
39
+ * and runtime mode controls. Markdown files are transformed into Svelte-aware
40
+ * modules while the core plugin provides shared parsing and embeds.
41
+ */
18
42
  interface SvelteIntegrationOptions extends OxContentOptions {
19
43
  /**
20
44
  * Markdown-like file extensions to process.
45
+ *
46
+ * Values are normalized with a leading dot before matching file paths.
47
+ *
21
48
  * @default ['.md', '.markdown', '.mdx']
22
49
  */
23
50
  extensions?: string[];
24
51
  /**
25
52
  * Components to register for use in Markdown.
53
+ *
26
54
  * Can be a map of names to paths, a glob pattern, or an array of globs.
27
55
  * When using glob patterns, component names are derived from file names.
28
56
  *
57
+ * @default {}
58
+ *
29
59
  * @example
30
60
  * ```ts
31
61
  * // Glob pattern (recommended)
@@ -36,25 +66,101 @@ interface SvelteIntegrationOptions extends OxContentOptions {
36
66
  * ```
37
67
  */
38
68
  components?: ComponentsOption;
69
+ /**
70
+ * Enable opt-in line annotations for fenced code blocks.
71
+ *
72
+ * Pass `true` to use the default `annotate` meta key, or an object to change it.
73
+ *
74
+ * @default false
75
+ */
39
76
  codeAnnotations?: boolean | CodeAnnotationsOptions;
77
+ /**
78
+ * Generate Svelte 5 runes-compatible runtime integration.
79
+ *
80
+ * Keep this enabled for Svelte 5 projects. Disable it only for compatibility
81
+ * with older runtime assumptions.
82
+ *
83
+ * @default true
84
+ */
40
85
  runes?: boolean;
86
+ /**
87
+ * Built-in static embeds rendered during Markdown transformation.
88
+ *
89
+ * Set to `false` to disable all built-in embeds.
90
+ * Configure individual fetch-related options under `github` and `openGraph`.
91
+ *
92
+ * @default { github: true, openGraph: true }
93
+ */
41
94
  embeds?: BuiltinEmbedOptions | false;
42
95
  }
96
+ /**
97
+ * Fetch options for Svelte GitHub embeds.
98
+ */
43
99
  interface GitHubEmbedOptions {
100
+ /**
101
+ * GitHub API token used for higher rate limits and private repository access.
102
+ * @default ''
103
+ */
44
104
  token?: string;
105
+ /**
106
+ * Cache fetched repository and source data in memory for the current process.
107
+ * @default true
108
+ */
45
109
  cache?: boolean;
110
+ /**
111
+ * Cache TTL in milliseconds.
112
+ * @default 3600000
113
+ */
46
114
  cacheTTL?: number;
115
+ /**
116
+ * Maximum source file size to inline in bytes.
117
+ * @default 200000
118
+ */
47
119
  maxSourceBytes?: number;
120
+ /**
121
+ * Maximum source lines to inline when no line range is specified.
122
+ * @default 120
123
+ */
48
124
  maxSourceLines?: number;
49
125
  }
126
+ /**
127
+ * Fetch options for Svelte Open Graph embeds.
128
+ */
50
129
  interface OpenGraphEmbedOptions {
130
+ /**
131
+ * Request timeout in milliseconds.
132
+ * @default 10000
133
+ */
51
134
  timeout?: number;
135
+ /**
136
+ * Cache fetched Open Graph metadata in memory for the current process.
137
+ * @default true
138
+ */
52
139
  cache?: boolean;
140
+ /**
141
+ * Cache TTL in milliseconds.
142
+ * @default 3600000
143
+ */
53
144
  cacheTTL?: number;
145
+ /**
146
+ * User agent sent with metadata fetch requests.
147
+ * @default 'ox-content-ogp-bot/1.0 (compatible; +https://github.com/ubugeeei-prod/ox-content)'
148
+ */
54
149
  userAgent?: string;
55
150
  }
151
+ /**
152
+ * Built-in embed options for the Svelte integration.
153
+ */
56
154
  interface BuiltinEmbedOptions {
155
+ /**
156
+ * Render `<GitHub repo="owner/name" />` repository cards.
157
+ * @default true
158
+ */
57
159
  github?: boolean | GitHubEmbedOptions;
160
+ /**
161
+ * Render `<OgCard url="https://example.com" />` Open Graph link cards.
162
+ * @default true
163
+ */
58
164
  openGraph?: boolean | OpenGraphEmbedOptions;
59
165
  }
60
166
  interface ResolvedBuiltinEmbedOptions {
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.mts","names":[],"sources":["../src/types.ts","../src/index.ts"],"mappings":";;;;UA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;;;;;AAQA;;;;;AASA;;;;;AASA;;;;;;;iBCgDgB,eAAA,CAAgB,OAAA,GAAS,wBAAA,GAAgC,YAAA"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ox-content/vite-plugin-svelte",
3
- "version": "2.66.0",
3
+ "version": "2.68.0",
4
4
  "description": "Svelte integration for Ox Content - Embed Svelte components in Markdown",
5
5
  "keywords": [
6
6
  "markdown",
@@ -34,8 +34,8 @@
34
34
  "provenance": true
35
35
  },
36
36
  "dependencies": {
37
- "@ox-content/islands": "2.66.0",
38
- "@ox-content/vite-plugin": "2.66.0"
37
+ "@ox-content/islands": "2.68.0",
38
+ "@ox-content/vite-plugin": "2.68.0"
39
39
  },
40
40
  "devDependencies": {
41
41
  "@sveltejs/vite-plugin-svelte": "^7.1.2",