lightnet 3.1.2 → 3.2.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 CHANGED
@@ -1,5 +1,11 @@
1
1
  # lightnet
2
2
 
3
+ ## 3.2.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [#246](https://github.com/LightNetDev/LightNet/pull/246) [`7c59151`](https://github.com/LightNetDev/LightNet/commit/7c59151a0d2eb698eff9891d0ba780ab29a6efe5) Thanks [@smn-cds](https://github.com/smn-cds)! - Add config option to set a footer component.
8
+
3
9
  ## 3.1.2
4
10
 
5
11
  ### Patch Changes
@@ -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.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"
9
+ export NODE_PATH="/home/runner/work/LightNet/LightNet/node_modules/.pnpm/astro@5.6.1_@types+node@22.14.0_jiti@2.4.2_lightningcss@1.29.1_rollup@4.39.0_terser@5.39.0_typescript@5.8.3_yaml@2.7.1/node_modules/astro/node_modules:/home/runner/work/LightNet/LightNet/node_modules/.pnpm/astro@5.6.1_@types+node@22.14.0_jiti@2.4.2_lightningcss@1.29.1_rollup@4.39.0_terser@5.39.0_typescript@5.8.3_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.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"
11
+ export NODE_PATH="/home/runner/work/LightNet/LightNet/node_modules/.pnpm/astro@5.6.1_@types+node@22.14.0_jiti@2.4.2_lightningcss@1.29.1_rollup@4.39.0_terser@5.39.0_typescript@5.8.3_yaml@2.7.1/node_modules/astro/node_modules:/home/runner/work/LightNet/LightNet/node_modules/.pnpm/astro@5.6.1_@types+node@22.14.0_jiti@2.4.2_lightningcss@1.29.1_rollup@4.39.0_terser@5.39.0_typescript@5.8.3_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" "$@"
@@ -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/typescript@5.8.2/node_modules/typescript/bin/node_modules:/home/runner/work/LightNet/LightNet/node_modules/.pnpm/typescript@5.8.2/node_modules/typescript/node_modules:/home/runner/work/LightNet/LightNet/node_modules/.pnpm/typescript@5.8.2/node_modules:/home/runner/work/LightNet/LightNet/node_modules/.pnpm/node_modules"
9
+ export NODE_PATH="/home/runner/work/LightNet/LightNet/node_modules/.pnpm/typescript@5.8.3/node_modules/typescript/bin/node_modules:/home/runner/work/LightNet/LightNet/node_modules/.pnpm/typescript@5.8.3/node_modules/typescript/node_modules:/home/runner/work/LightNet/LightNet/node_modules/.pnpm/typescript@5.8.3/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/typescript@5.8.2/node_modules/typescript/bin/node_modules:/home/runner/work/LightNet/LightNet/node_modules/.pnpm/typescript@5.8.2/node_modules/typescript/node_modules:/home/runner/work/LightNet/LightNet/node_modules/.pnpm/typescript@5.8.2/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/typescript@5.8.3/node_modules/typescript/bin/node_modules:/home/runner/work/LightNet/LightNet/node_modules/.pnpm/typescript@5.8.3/node_modules/typescript/node_modules:/home/runner/work/LightNet/LightNet/node_modules/.pnpm/typescript@5.8.3/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/../typescript/bin/tsc" "$@"
@@ -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/typescript@5.8.2/node_modules/typescript/bin/node_modules:/home/runner/work/LightNet/LightNet/node_modules/.pnpm/typescript@5.8.2/node_modules/typescript/node_modules:/home/runner/work/LightNet/LightNet/node_modules/.pnpm/typescript@5.8.2/node_modules:/home/runner/work/LightNet/LightNet/node_modules/.pnpm/node_modules"
9
+ export NODE_PATH="/home/runner/work/LightNet/LightNet/node_modules/.pnpm/typescript@5.8.3/node_modules/typescript/bin/node_modules:/home/runner/work/LightNet/LightNet/node_modules/.pnpm/typescript@5.8.3/node_modules/typescript/node_modules:/home/runner/work/LightNet/LightNet/node_modules/.pnpm/typescript@5.8.3/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/typescript@5.8.2/node_modules/typescript/bin/node_modules:/home/runner/work/LightNet/LightNet/node_modules/.pnpm/typescript@5.8.2/node_modules/typescript/node_modules:/home/runner/work/LightNet/LightNet/node_modules/.pnpm/typescript@5.8.2/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/typescript@5.8.3/node_modules/typescript/bin/node_modules:/home/runner/work/LightNet/LightNet/node_modules/.pnpm/typescript@5.8.3/node_modules/typescript/node_modules:/home/runner/work/LightNet/LightNet/node_modules/.pnpm/typescript@5.8.3/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/../typescript/bin/tsserver" "$@"
@@ -7,12 +7,12 @@
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.6.0",
11
- "lightnet": "^3.1.1",
10
+ "astro": "^5.6.1",
11
+ "lightnet": "^3.2.0",
12
12
  "react": "^19.1.0",
13
13
  "react-dom": "^19.1.0",
14
14
  "sharp": "^0.33.5",
15
15
  "tailwindcss": "^3.4.17",
16
- "typescript": "^5.8.2"
16
+ "typescript": "^5.8.3"
17
17
  }
18
18
  }
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "lightnet",
3
3
  "type": "module",
4
4
  "license": "MIT",
5
- "version": "3.1.2",
5
+ "version": "3.2.0",
6
6
  "repository": {
7
7
  "type": "git",
8
8
  "url": "https://github.com/LightNetDev/lightnet",
@@ -180,12 +180,18 @@ export const configSchema = z.object({
180
180
  */
181
181
  internalDomains: z.array(z.string()).default([]),
182
182
  /**
183
- * Path to an Astro component to be added to the HTML head element of all pages.
183
+ * Path to an Astro component to be added into the HTML head element of all pages.
184
184
  * For example use this if you need to add an analytics script to every page.
185
185
  *
186
186
  * @example "./src/components/MyHeadTag.astro"
187
187
  */
188
188
  headComponent: z.string().optional(),
189
+ /**
190
+ * Path to an Astro component to be added at the bottom of all pages.
191
+ *
192
+ * @example "./src/components/MyFooter.astro"
193
+ */
194
+ footerComponent: z.string().optional(),
189
195
  /**
190
196
  * Configure search page behavior
191
197
  */
@@ -13,7 +13,12 @@ declare module "virtual:lightnet/project-context" {
13
13
  export default context
14
14
  }
15
15
 
16
- declare module "virtual:lightnet/components/CustomHeadComponent" {
17
- const CustomHeadComponent: ((props: Record<string, any>) => any) | undefined
18
- export default CustomHeadComponent
16
+ declare module "virtual:lightnet/components/CustomHead" {
17
+ const CustomHead: ((props: Record<string, any>) => any) | undefined
18
+ export default CustomHead
19
+ }
20
+
21
+ declare module "virtual:lightnet/components/CustomFooter" {
22
+ const CustomFooter: ((props: Record<string, any>) => any) | undefined
23
+ export default CustomFooter
19
24
  }
@@ -8,13 +8,15 @@ import { type LightnetConfig } from "./config"
8
8
  const CONFIG = "virtual:lightnet/config"
9
9
  const LOGO = "virtual:lightnet/logo"
10
10
  const PROJECT_CONTEXT = "virtual:lightnet/project-context"
11
- const CUSTOM_HEAD_COMPONENT = "virtual:lightnet/components/CustomHeadComponent"
11
+ const CUSTOM_HEAD = "virtual:lightnet/components/CustomHead"
12
+ const CUSTOM_FOOTER = "virtual:lightnet/components/CustomFooter"
12
13
 
13
14
  const VIRTUAL_MODULES = [
14
15
  CONFIG,
15
16
  LOGO,
16
17
  PROJECT_CONTEXT,
17
- CUSTOM_HEAD_COMPONENT,
18
+ CUSTOM_HEAD,
19
+ CUSTOM_FOOTER,
18
20
  ] as const
19
21
 
20
22
  export function vitePluginLightnetConfig(
@@ -52,10 +54,14 @@ export function vitePluginLightnetConfig(
52
54
  : "export default undefined;"
53
55
  case PROJECT_CONTEXT:
54
56
  return `export default ${JSON.stringify({ root, srcDir, site })}`
55
- case CUSTOM_HEAD_COMPONENT:
57
+ case CUSTOM_HEAD:
56
58
  return config.headComponent
57
59
  ? `export { default } from ${resolveFilePath(config.headComponent)};`
58
60
  : "export default undefined;"
61
+ case CUSTOM_FOOTER:
62
+ return config.footerComponent
63
+ ? `export { default } from ${resolveFilePath(config.footerComponent)};`
64
+ : "export default undefined;"
59
65
  }
60
66
  },
61
67
  }
@@ -1,6 +1,7 @@
1
1
  ---
2
2
  import { ClientRouter } from "astro:transitions"
3
- import CustomHeadComponent from "virtual:lightnet/components/CustomHeadComponent"
3
+ import CustomFooter from "virtual:lightnet/components/CustomFooter"
4
+ import CustomHead from "virtual:lightnet/components/CustomHead"
4
5
  import config from "virtual:lightnet/config"
5
6
 
6
7
  import { resolveLanguage } from "../i18n/resolve-language"
@@ -26,7 +27,7 @@ const language = resolveLanguage(currentLocale)
26
27
  <head>
27
28
  <meta charset="UTF-8" />
28
29
  <meta name="viewport" content="width=device-width, initial-scale=1.0" />
29
- {CustomHeadComponent && <CustomHeadComponent />}
30
+ {CustomHead && <CustomHead />}
30
31
  <title>{title ? `${title} | ${configTitle}` : configTitle}</title>
31
32
  {description && <meta name="description" content={description} />}
32
33
  {config.manifest && <link rel="manifest" href={config.manifest} />}
@@ -34,7 +35,9 @@ const language = resolveLanguage(currentLocale)
34
35
  <Favicon />
35
36
  <ClientRouter />
36
37
  </head>
37
- <body class="overflow-y-scroll bg-gray-50 text-gray-900">
38
+ <body
39
+ class="flex min-h-screen flex-col overflow-y-scroll bg-gray-50 text-gray-900"
40
+ >
38
41
  <header
39
42
  class="fixed top-0 z-50 h-14 w-full bg-white shadow-lg sm:h-20"
40
43
  transition:animate="none"
@@ -46,9 +49,10 @@ const language = resolveLanguage(currentLocale)
46
49
  <PageNavigation />
47
50
  </div>
48
51
  </header>
49
- <main class="mx-auto min-h-screen pb-8 pt-14 sm:py-20">
52
+ <main class="grow pb-8 pt-14 sm:py-20">
50
53
  <slot />
51
54
  </main>
55
+ {CustomFooter && <CustomFooter />}
52
56
  <PreloadReact client:idle />
53
57
  </body>
54
58
  </html>