starlight-obsidian 0.5.0 → 0.6.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/CHANGELOG.md ADDED
@@ -0,0 +1,11 @@
1
+ # starlight-obsidian
2
+
3
+ ## 0.6.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [#34](https://github.com/HiDeoo/starlight-obsidian/pull/34) [`9079b9b`](https://github.com/HiDeoo/starlight-obsidian/commit/9079b9be67eb2efd68a3d8906068263657629974) Thanks [@HiDeoo](https://github.com/HiDeoo)! - Adds support for Astro v5, drops support for Astro v4.
8
+
9
+ ⚠️ **BREAKING CHANGE:** The minimum supported version of Starlight is now `0.30.0`.
10
+
11
+ Please follow the [upgrade guide](https://github.com/withastro/starlight/releases/tag/%40astrojs/starlight%400.30.0) to update your project.
package/libs/obsidian.ts CHANGED
@@ -224,8 +224,8 @@ interface BaseVaultFile {
224
224
  }
225
225
 
226
226
  export interface VaultFile extends BaseVaultFile {
227
- isEqualFileName(otherFileName: string): boolean
228
- isEqualStem(otherStem: string): boolean
227
+ isEqualFileName: (otherFileName: string) => boolean
228
+ isEqualStem: (otherStem: string) => boolean
229
229
  }
230
230
 
231
231
  export type ObsidianFrontmatter = z.output<typeof obsidianFrontmatterSchema> & {
package/libs/rehype.ts CHANGED
@@ -82,7 +82,7 @@ function isNodeWithValue(node: ElementContent | undefined): node is NodeWithValu
82
82
  }
83
83
 
84
84
  function getBlockIdentifer(node: NodeWithValue): { length: number; name: string } | undefined {
85
- const match = node.value.match(blockIdentifierRegex)
85
+ const match = blockIdentifierRegex.exec(node.value)
86
86
  const identifier = match?.groups?.['identifier']
87
87
  const name = match?.groups?.['name']
88
88
 
package/libs/remark.ts CHANGED
@@ -377,7 +377,7 @@ function handleBlockquotes(node: Blockquote, context: VisitorContext) {
377
377
  return SKIP
378
378
  }
379
379
 
380
- const match = firstLine.match(calloutRegex)
380
+ const match = calloutRegex.exec(firstLine)
381
381
 
382
382
  const { title, type } = match?.groups ?? {}
383
383
 
@@ -566,7 +566,7 @@ function handleImagesWithSize(node: Image, context: VisitorContext, type: 'asset
566
566
  return
567
567
  }
568
568
 
569
- const match = node.alt.match(imageSizeRegex)
569
+ const match = imageSizeRegex.exec(node.alt)
570
570
  const { altText, width, widthOnly, height } = match?.groups ?? {}
571
571
 
572
572
  if (widthOnly === undefined && width === undefined) {
package/libs/starlight.ts CHANGED
@@ -280,7 +280,7 @@ function throwVaultFileError(error: unknown, vaultFile: VaultFile): never {
280
280
  }
281
281
 
282
282
  function isSidebarGroup(item: SidebarGroup): item is SidebarManualGroup {
283
- return 'items' in item
283
+ return typeof item === 'object' && 'items' in item
284
284
  }
285
285
 
286
286
  interface OutputPaths {
@@ -6,6 +6,7 @@ import Tags from '../components/Tags.astro'
6
6
 
7
7
  const { entry } = Astro.props
8
8
 
9
+ // @ts-expect-error - This plugin does not extend Starlight's schema so tags are unknown.
9
10
  const tags = entry['data']['tags']
10
11
  const showTags = tags !== undefined && tags.length > 0
11
12
  ---
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "starlight-obsidian",
3
- "version": "0.5.0",
3
+ "version": "0.6.0",
4
4
  "license": "MIT",
5
5
  "description": "Starlight plugin to publish Obsidian vaults.",
6
6
  "author": "HiDeoo <github@hideoo.dev> (https://hideoo.dev)",
@@ -17,53 +17,52 @@
17
17
  "./package.json": "./package.json"
18
18
  },
19
19
  "dependencies": {
20
- "@astro-community/astro-embed-twitter": "0.5.3",
21
- "@astro-community/astro-embed-youtube": "0.4.4",
22
- "@astrojs/markdown-remark": "4.2.1",
23
- "decode-uri-component": "0.4.1",
24
- "github-slugger": "2.0.0",
25
- "globby": "14.0.0",
26
- "hast-util-to-html": "9.0.0",
27
- "hast-util-to-string": "3.0.0",
28
- "hastscript": "9.0.0",
29
- "html-escaper": "3.0.3",
30
- "is-absolute-url": "4.0.1",
31
- "mdast-util-find-and-replace": "3.0.1",
32
- "mdast-util-from-markdown": "2.0.0",
33
- "mdast-util-to-hast": "13.1.0",
34
- "nanoid": "5.0.4",
35
- "rehype": "13.0.1",
36
- "rehype-autolink-headings": "7.1.0",
37
- "rehype-katex": "7.0.0",
38
- "rehype-mermaid": "2.1.0",
39
- "remark": "15.0.1",
40
- "remark-frontmatter": "5.0.0",
41
- "remark-gfm": "4.0.0",
42
- "remark-math": "6.0.0",
43
- "unist-util-visit": "5.0.0",
44
- "vfile": "6.0.1",
45
- "yaml": "2.3.4"
20
+ "@astro-community/astro-embed-twitter": "^0.5.8",
21
+ "@astro-community/astro-embed-youtube": "^0.5.6",
22
+ "@astrojs/markdown-remark": "^6.0.0",
23
+ "decode-uri-component": "^0.4.1",
24
+ "github-slugger": "^2.0.0",
25
+ "globby": "^14.0.2",
26
+ "hast-util-to-html": "^9.0.4",
27
+ "hast-util-to-string": "^3.0.1",
28
+ "hastscript": "^9.0.0",
29
+ "html-escaper": "^3.0.3",
30
+ "is-absolute-url": "^4.0.1",
31
+ "mdast-util-find-and-replace": "^3.0.1",
32
+ "mdast-util-from-markdown": "^2.0.2",
33
+ "mdast-util-to-hast": "^13.2.0",
34
+ "nanoid": "^5.0.9",
35
+ "rehype": "^13.0.2",
36
+ "rehype-autolink-headings": "^7.1.0",
37
+ "rehype-katex": "^7.0.1",
38
+ "rehype-mermaid": "^2.1.0",
39
+ "remark": "^15.0.1",
40
+ "remark-frontmatter": "^5.0.0",
41
+ "remark-gfm": "^4.0.0",
42
+ "remark-math": "^6.0.0",
43
+ "unist-util-visit": "^5.0.0",
44
+ "vfile": "^6.0.3",
45
+ "yaml": "^2.6.1"
46
46
  },
47
47
  "devDependencies": {
48
- "@astrojs/starlight": "0.24.4",
49
- "@types/hast": "3.0.3",
50
- "@types/html-escaper": "3.0.2",
51
- "@types/mdast": "4.0.3",
52
- "@types/unist": "3.0.2",
53
- "astro": "4.11.1",
54
- "typescript": "5.3.3",
55
- "vitest": "1.2.1"
48
+ "@types/hast": "^3.0.4",
49
+ "@types/html-escaper": "^3.0.2",
50
+ "@types/mdast": "^4.0.4",
51
+ "@types/node": "^18.19.68",
52
+ "@types/unist": "^3.0.3",
53
+ "typescript": "^5.7.2",
54
+ "vitest": "2.1.6"
56
55
  },
57
56
  "peerDependencies": {
58
- "@astrojs/starlight": ">=0.15.0",
59
- "astro": ">=4.0.0"
57
+ "@astrojs/starlight": ">=0.30.0"
60
58
  },
61
59
  "engines": {
62
- "node": ">=18.14.1"
60
+ "node": ">=18.17.1"
63
61
  },
64
62
  "packageManager": "pnpm@8.14.1",
65
63
  "publishConfig": {
66
- "access": "public"
64
+ "access": "public",
65
+ "provenance": true
67
66
  },
68
67
  "sideEffects": false,
69
68
  "keywords": [
@@ -77,11 +76,12 @@
77
76
  "homepage": "https://github.com/HiDeoo/starlight-obsidian",
78
77
  "repository": {
79
78
  "type": "git",
80
- "url": "https://github.com/HiDeoo/starlight-obsidian.git"
79
+ "url": "https://github.com/HiDeoo/starlight-obsidian.git",
80
+ "directory": "packages/starlight-obsidian"
81
81
  },
82
82
  "bugs": "https://github.com/HiDeoo/starlight-obsidian/issues",
83
83
  "scripts": {
84
84
  "test": "vitest",
85
- "lint": "prettier -c --cache . && eslint . --cache --max-warnings=0"
85
+ "lint": "eslint . --cache --max-warnings=0"
86
86
  }
87
87
  }