lightnet 3.1.0 → 3.1.2

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 CHANGED
@@ -1,5 +1,20 @@
1
1
  # lightnet
2
2
 
3
+ ## 3.1.2
4
+
5
+ ### Patch Changes
6
+
7
+ - [#247](https://github.com/LightNetDev/LightNet/pull/247) [`6f926f7`](https://github.com/LightNetDev/LightNet/commit/6f926f7c51753907154c70ad6bcb335813f8829f) Thanks [@smn-cds](https://github.com/smn-cds)! - Fix invalid i18n config passed to Astro.
8
+
9
+ ## 3.1.1
10
+
11
+ ### Patch Changes
12
+
13
+ - [#243](https://github.com/LightNetDev/LightNet/pull/243) [`735e984`](https://github.com/LightNetDev/LightNet/commit/735e984ee00e67bc0d326e4e67efd45cf10b73e0) Thanks [@smn-cds](https://github.com/smn-cds)! - Fix open button label for websites
14
+
15
+ Before website links e.g. https://wikipedia.org showed a "Download" button on the details page.
16
+ With this fix they show a "Open" button.
17
+
3
18
  ## 3.1.0
4
19
 
5
20
  ### Minor Changes
package/README.md CHANGED
@@ -6,7 +6,7 @@ LightNet is built as an integration for the [Astro](https://astro.build) framewo
6
6
 
7
7
  ## Documentation
8
8
 
9
- [Read the LightNet docs](https://lightnet-docs.pages.dev) to learn how to use LightNet.
9
+ [Read the LightNet docs](https://docs.lightnet.community) to learn how to use LightNet.
10
10
 
11
11
  ## Example site
12
12
 
@@ -6,9 +6,9 @@ case `uname` in
6
6
  esac
7
7
 
8
8
  if [ -z "$NODE_PATH" ]; then
9
- export NODE_PATH="/home/runner/work/LightNet/LightNet/node_modules/.pnpm/astro@5.5.6_@types+node@22.13.15_jiti@2.4.2_lightningcss@1.29.1_rollup@4.38.0_terser@5.39.0_typescript@5.8.2_yaml@2.7.1/node_modules/astro/node_modules:/home/runner/work/LightNet/LightNet/node_modules/.pnpm/astro@5.5.6_@types+node@22.13.15_jiti@2.4.2_lightningcss@1.29.1_rollup@4.38.0_terser@5.39.0_typescript@5.8.2_yaml@2.7.1/node_modules:/home/runner/work/LightNet/LightNet/node_modules/.pnpm/node_modules"
9
+ export NODE_PATH="/home/runner/work/LightNet/LightNet/node_modules/.pnpm/astro@5.6.0_@types+node@22.14.0_jiti@2.4.2_lightningcss@1.29.1_rollup@4.39.0_terser@5.39.0_typescript@5.8.2_yaml@2.7.1/node_modules/astro/node_modules:/home/runner/work/LightNet/LightNet/node_modules/.pnpm/astro@5.6.0_@types+node@22.14.0_jiti@2.4.2_lightningcss@1.29.1_rollup@4.39.0_terser@5.39.0_typescript@5.8.2_yaml@2.7.1/node_modules:/home/runner/work/LightNet/LightNet/node_modules/.pnpm/node_modules"
10
10
  else
11
- export NODE_PATH="/home/runner/work/LightNet/LightNet/node_modules/.pnpm/astro@5.5.6_@types+node@22.13.15_jiti@2.4.2_lightningcss@1.29.1_rollup@4.38.0_terser@5.39.0_typescript@5.8.2_yaml@2.7.1/node_modules/astro/node_modules:/home/runner/work/LightNet/LightNet/node_modules/.pnpm/astro@5.5.6_@types+node@22.13.15_jiti@2.4.2_lightningcss@1.29.1_rollup@4.38.0_terser@5.39.0_typescript@5.8.2_yaml@2.7.1/node_modules:/home/runner/work/LightNet/LightNet/node_modules/.pnpm/node_modules:$NODE_PATH"
11
+ export NODE_PATH="/home/runner/work/LightNet/LightNet/node_modules/.pnpm/astro@5.6.0_@types+node@22.14.0_jiti@2.4.2_lightningcss@1.29.1_rollup@4.39.0_terser@5.39.0_typescript@5.8.2_yaml@2.7.1/node_modules/astro/node_modules:/home/runner/work/LightNet/LightNet/node_modules/.pnpm/astro@5.6.0_@types+node@22.14.0_jiti@2.4.2_lightningcss@1.29.1_rollup@4.39.0_terser@5.39.0_typescript@5.8.2_yaml@2.7.1/node_modules:/home/runner/work/LightNet/LightNet/node_modules/.pnpm/node_modules:$NODE_PATH"
12
12
  fi
13
13
  if [ -x "$basedir/node" ]; then
14
14
  exec "$basedir/node" "$basedir/../astro/astro.js" "$@"
@@ -7,8 +7,8 @@
7
7
  "@astrojs/react": "^4.2.3",
8
8
  "@astrojs/tailwind": "^6.0.2",
9
9
  "@lightnet/decap-admin": "^3.1.0",
10
- "astro": "^5.5.6",
11
- "lightnet": "^3.1.0",
10
+ "astro": "^5.6.0",
11
+ "lightnet": "^3.1.1",
12
12
  "react": "^19.1.0",
13
13
  "react-dom": "^19.1.0",
14
14
  "sharp": "^0.33.5",
@@ -25,6 +25,17 @@ test("Should create complete content metadata", () => {
25
25
  type: "link",
26
26
  },
27
27
  },
28
+ {
29
+ url: "https://wikipedia.org",
30
+ expected: {
31
+ canBeOpened: true,
32
+ target: "_blank",
33
+ label: "wikipedia.org",
34
+ isExternal: true,
35
+ extension: "",
36
+ type: "link",
37
+ },
38
+ },
28
39
  {
29
40
  url: "https://some.host/some.pDf",
30
41
  expected: {
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "lightnet",
3
3
  "type": "module",
4
4
  "license": "MIT",
5
- "version": "3.1.0",
5
+ "version": "3.1.2",
6
6
  "repository": {
7
7
  "type": "git",
8
8
  "url": "https://github.com/LightNetDev/lightnet",
@@ -45,7 +45,7 @@
45
45
  "@iconify-json/mdi": "^1.2.3",
46
46
  "@iconify/tailwind": "^1.2.0",
47
47
  "@tailwindcss/typography": "^0.5.16",
48
- "@types/react": "^19.0.12",
48
+ "@types/react": "^19.1.0",
49
49
  "daisyui": "^4.12.24",
50
50
  "fuse.js": "^7.1.0",
51
51
  "i18next": "^24.2.3",
@@ -55,7 +55,7 @@
55
55
  },
56
56
  "devDependencies": {
57
57
  "@playwright/test": "^1.51.1",
58
- "@types/node": "^22.13.15",
58
+ "@types/node": "^22.14.0",
59
59
  "vitest": "^3.1.1"
60
60
  },
61
61
  "scripts": {
@@ -69,7 +69,7 @@ export function lightnet(lightnetConfig: LightnetConfig): AstroIntegration {
69
69
  locales: resolveLocales(config),
70
70
  routing: {
71
71
  redirectToDefaultLocale: false,
72
- prefixDefaultLocale: false,
72
+ prefixDefaultLocale: true,
73
73
  fallbackType: "rewrite",
74
74
  },
75
75
  },
@@ -49,17 +49,18 @@ export function createContentMetadata({
49
49
  url: string
50
50
  label?: string
51
51
  }) {
52
- const lastUrlSegment = url.split("/").slice(-1)[0]
53
- const hasExtension = lastUrlSegment.includes(".")
52
+ const isExternal = isExternalUrl(url)
53
+ const path = isExternal ? new URL(url).pathname : url
54
+
55
+ const lastPathSegment = path.split("/").slice(-1)[0]
56
+ const hasExtension = lastPathSegment.includes(".")
54
57
  const extension = hasExtension
55
- ? lastUrlSegment.split(".").slice(-1)[0].toLowerCase()
58
+ ? lastPathSegment.split(".").slice(-1)[0].toLowerCase()
56
59
  : ""
57
60
 
58
- const isExternal = isExternalUrl(url)
59
-
60
- const linkName = isExternal ? new URL(url).hostname : lastUrlSegment
61
+ const linkName = isExternal ? new URL(url).hostname : lastPathSegment
61
62
  const fileName = hasExtension
62
- ? lastUrlSegment.slice(0, -(extension.length + 1))
63
+ ? lastPathSegment.slice(0, -(extension.length + 1))
63
64
  : undefined
64
65
  const label = customLabel ?? fileName ?? linkName
65
66
  const type = KNOWN_EXTENSIONS[extension]?.type ?? "link"