starlight-links-validator 0.19.2 → 0.20.1
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 +16 -0
- package/index.ts +1 -1
- package/libs/config.ts +6 -6
- package/libs/remark.ts +1 -1
- package/package.json +11 -12
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,21 @@
|
|
|
1
1
|
# starlight-links-validator
|
|
2
2
|
|
|
3
|
+
## 0.20.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#139](https://github.com/HiDeoo/starlight-links-validator/pull/139) [`01c0073`](https://github.com/HiDeoo/starlight-links-validator/commit/01c0073153a3b7d723864f438f26a164ba9e9a7b) Thanks [@HiDeoo](https://github.com/HiDeoo)! - Fixes a regression in version `0.20.0` incorrectly reporting non HTTP-based URL links as invalid, e.g. `mailto:` links.
|
|
8
|
+
|
|
9
|
+
## 0.20.0
|
|
10
|
+
|
|
11
|
+
### Minor Changes
|
|
12
|
+
|
|
13
|
+
- [#136](https://github.com/HiDeoo/starlight-links-validator/pull/136) [`7f6b843`](https://github.com/HiDeoo/starlight-links-validator/commit/7f6b8434bac3d07511a16152226dea08067e5b7c) Thanks [@HiDeoo](https://github.com/HiDeoo)! - Adds support for Astro v6, drops support for Astro v5.
|
|
14
|
+
|
|
15
|
+
⚠️ **BREAKING CHANGE:** The minimum supported version of Starlight is now `0.38.0`.
|
|
16
|
+
|
|
17
|
+
Please follow the [upgrade guide](https://github.com/withastro/starlight/releases/tag/%40astrojs%2Fstarlight%400.38.0) to update your project.
|
|
18
|
+
|
|
3
19
|
## 0.19.2
|
|
4
20
|
|
|
5
21
|
### Patch Changes
|
package/index.ts
CHANGED
|
@@ -60,7 +60,7 @@ export default function starlightLinksValidatorPlugin(
|
|
|
60
60
|
|
|
61
61
|
for (const [pattern, urls] of assets) {
|
|
62
62
|
const route = routes.find((route) => route.pattern === pattern)
|
|
63
|
-
if (
|
|
63
|
+
if (route?.origin !== 'project') continue
|
|
64
64
|
|
|
65
65
|
for (const url of urls) {
|
|
66
66
|
customPages.add(pathnameToSlug(url.pathname.replace(astroConfig.outDir.pathname, '')))
|
package/libs/config.ts
CHANGED
|
@@ -64,9 +64,8 @@ export const StarlightLinksValidatorOptionsSchema = z
|
|
|
64
64
|
exclude: z
|
|
65
65
|
.union([
|
|
66
66
|
z.array(z.string()),
|
|
67
|
-
z
|
|
68
|
-
|
|
69
|
-
.args(
|
|
67
|
+
z.function({
|
|
68
|
+
input: [
|
|
70
69
|
z.object({
|
|
71
70
|
/**
|
|
72
71
|
* The absolute path to the file where the link is defined.
|
|
@@ -81,8 +80,9 @@ export const StarlightLinksValidatorOptionsSchema = z
|
|
|
81
80
|
*/
|
|
82
81
|
slug: z.string(),
|
|
83
82
|
}),
|
|
84
|
-
|
|
85
|
-
|
|
83
|
+
],
|
|
84
|
+
output: z.boolean(),
|
|
85
|
+
}),
|
|
86
86
|
])
|
|
87
87
|
.default([]),
|
|
88
88
|
/**
|
|
@@ -100,7 +100,7 @@ export const StarlightLinksValidatorOptionsSchema = z
|
|
|
100
100
|
*/
|
|
101
101
|
sameSitePolicy: z.enum(['error', 'ignore', 'validate']).default('ignore'),
|
|
102
102
|
})
|
|
103
|
-
.
|
|
103
|
+
.prefault({})
|
|
104
104
|
|
|
105
105
|
export type StarlightLinksValidatorUserOptions = z.input<typeof StarlightLinksValidatorOptionsSchema>
|
|
106
106
|
export type StarlightLinksValidatorOptions = z.output<typeof StarlightLinksValidatorOptionsSchema>
|
package/libs/remark.ts
CHANGED
|
@@ -177,7 +177,7 @@ export function getValidationData(): ValidationData {
|
|
|
177
177
|
function getLinkToValidate(link: string, { options, site }: RemarkStarlightLinksValidatorConfig): Link | undefined {
|
|
178
178
|
const linkTovalidate = { raw: link }
|
|
179
179
|
|
|
180
|
-
if (!isAbsoluteUrl(link)) {
|
|
180
|
+
if (!isAbsoluteUrl(link, { httpOnly: false })) {
|
|
181
181
|
return linkTovalidate
|
|
182
182
|
}
|
|
183
183
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "starlight-links-validator",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.20.1",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"description": "Starlight plugin to validate internal links.",
|
|
6
6
|
"author": "HiDeoo <github@hideoo.dev> (https://hideoo.dev)",
|
|
@@ -10,37 +10,36 @@
|
|
|
10
10
|
"./package.json": "./package.json"
|
|
11
11
|
},
|
|
12
12
|
"dependencies": {
|
|
13
|
-
"@types/picomatch": "^
|
|
13
|
+
"@types/picomatch": "^4.0.2",
|
|
14
14
|
"github-slugger": "^2.0.0",
|
|
15
15
|
"hast-util-from-html": "^2.0.3",
|
|
16
16
|
"hast-util-has-property": "^3.0.0",
|
|
17
|
-
"is-absolute-url": "^
|
|
17
|
+
"is-absolute-url": "^5.0.0",
|
|
18
18
|
"kleur": "^4.1.5",
|
|
19
|
-
"mdast-util-mdx-jsx": "^3.
|
|
19
|
+
"mdast-util-mdx-jsx": "^3.2.0",
|
|
20
20
|
"mdast-util-to-string": "^4.0.0",
|
|
21
|
-
"picomatch": "^4.0.
|
|
21
|
+
"picomatch": "^4.0.3",
|
|
22
22
|
"terminal-link": "^5.0.0",
|
|
23
|
-
"unist-util-visit": "^5.
|
|
23
|
+
"unist-util-visit": "^5.1.0"
|
|
24
24
|
},
|
|
25
25
|
"devDependencies": {
|
|
26
26
|
"@types/hast": "^3.0.4",
|
|
27
27
|
"@types/mdast": "^4.0.4",
|
|
28
|
-
"@types/node": "^
|
|
28
|
+
"@types/node": "^22.19.15",
|
|
29
29
|
"remark-custom-heading-id": "^2.0.0",
|
|
30
30
|
"remark-parse": "^11.0.0",
|
|
31
31
|
"remark-stringify": "^11.0.0",
|
|
32
32
|
"unified": "^11.0.5",
|
|
33
33
|
"vfile": "^6.0.3",
|
|
34
|
-
"vitest": "
|
|
34
|
+
"vitest": "^4.0.18"
|
|
35
35
|
},
|
|
36
36
|
"peerDependencies": {
|
|
37
|
-
"@astrojs/starlight": ">=0.
|
|
38
|
-
"astro": ">=
|
|
37
|
+
"@astrojs/starlight": ">=0.38.0",
|
|
38
|
+
"astro": ">=6.0.0"
|
|
39
39
|
},
|
|
40
40
|
"engines": {
|
|
41
|
-
"node": ">=
|
|
41
|
+
"node": ">=22.12.0"
|
|
42
42
|
},
|
|
43
|
-
"packageManager": "pnpm@8.6.3",
|
|
44
43
|
"publishConfig": {
|
|
45
44
|
"access": "public"
|
|
46
45
|
},
|