@tobi-or-not/docpress 0.10.2 → 0.11.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.
@@ -3,6 +3,17 @@ import { useData } from 'vitepress'
3
3
 
4
4
  const { frontmatter } = useData()
5
5
  const repositories = frontmatter.value.repoList || []
6
+
7
+ // Only allow http(s) links to be rendered as-is; anything else (e.g. a
8
+ // `javascript:` scheme) is neutralised to avoid an href-injection vector.
9
+ function safeUrl(url) {
10
+ try {
11
+ const { protocol } = new URL(url)
12
+ return protocol === 'https:' || protocol === 'http:' ? url : '#'
13
+ } catch {
14
+ return '#'
15
+ }
16
+ }
6
17
  </script>
7
18
 
8
19
  <template>
@@ -13,7 +24,7 @@ const repositories = frontmatter.value.repoList || []
13
24
  <a
14
25
  v-for="repo in repositories"
15
26
  :key="repo.name"
16
- :href="repo.html_url"
27
+ :href="safeUrl(repo.html_url)"
17
28
  target="_blank"
18
29
  rel="noopener noreferrer"
19
30
  class="repo-card VPFeature link"
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@tobi-or-not/docpress",
3
3
  "type": "module",
4
- "version": "0.10.2",
4
+ "version": "0.11.0",
5
5
  "packageManager": "bun@1.3.14",
6
6
  "homepage": "https://this-is-tobi.com/docpress/introduction",
7
7
  "repository": {
@@ -16,16 +16,17 @@
16
16
  "dist"
17
17
  ],
18
18
  "engines": {
19
- "node": ">=22.12.0"
19
+ "node": ">=22.12.0",
20
+ "bun": ">=1.3.0"
20
21
  },
21
22
  "scripts": {
22
23
  "build": "bun run build:clean && bun run build:types && bun run build:vite",
23
- "build:clean": "rimraf ./dist ./types ./tsconfig.tsbuildinfo",
24
+ "build:clean": "node -e \"for (const p of ['./dist','./types','./tsconfig.tsbuildinfo']) require('node:fs').rmSync(p,{recursive:true,force:true})\"",
24
25
  "build:docker": "docker build --tag tobi-or-not/docpress --target prod .",
25
26
  "build:types": "tsc",
26
27
  "build:vite": "vite build",
27
- "dev": "bun ./dev/docpress.ts",
28
- "dev:clean": "rimraf ./docpress && bun run dev",
28
+ "dev": "NODE_ENV=development bun ./dev/docpress.ts",
29
+ "dev:clean": "node -e \"require('node:fs').rmSync('./docpress',{recursive:true,force:true})\" && bun run dev",
29
30
  "format": "eslint . --fix",
30
31
  "lint": "eslint .",
31
32
  "prepare": "husky || true",
@@ -42,9 +43,8 @@
42
43
  },
43
44
  "dependencies": {
44
45
  "@octokit/rest": "^22.0.1",
45
- "chalk": "^5.6.2",
46
46
  "commander": "^15.0.0",
47
- "rimraf": "^6.1.3",
47
+ "picocolors": "^1.1.1",
48
48
  "simple-git": "^3.36.0",
49
49
  "vitepress": "^1.6.4",
50
50
  "vitepress-plugin-mermaid": "^2.0.17",
@@ -53,19 +53,19 @@
53
53
  },
54
54
  "devDependencies": {
55
55
  "@antfu/eslint-config": "^9.1.0",
56
- "@commitlint/cli": "^21.2.0",
56
+ "@commitlint/cli": "^21.2.1",
57
57
  "@commitlint/config-conventional": "^21.2.0",
58
58
  "@octokit/types": "^16.0.0",
59
- "@types/node": "^26.1.0",
60
- "@vitejs/plugin-vue": "^6.0.7",
61
- "@vitest/coverage-v8": "^4.1.9",
62
- "eslint": "^10.6.0",
59
+ "@types/node": "^26.1.1",
60
+ "@vitejs/plugin-vue": "^6.0.8",
61
+ "@vitest/coverage-v8": "^4.1.10",
62
+ "eslint": "^10.7.0",
63
63
  "husky": "^9.1.7",
64
- "lint-staged": "^17.0.8",
64
+ "nano-staged": "^1.0.2",
65
65
  "typescript": "^6.0.3",
66
- "vite": "^8.1.3",
67
- "vitest": "^4.1.9",
68
- "vue": "^3.5.39"
66
+ "vite": "^8.1.5",
67
+ "vitest": "^4.1.10",
68
+ "vue": "^3.5.40"
69
69
  },
70
70
  "publishConfig": {
71
71
  "registry": "https://registry.npmjs.org/",