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 +6 -0
- package/__e2e__/fixtures/basics/node_modules/.bin/astro +2 -2
- package/__e2e__/fixtures/basics/node_modules/.bin/tsc +2 -2
- package/__e2e__/fixtures/basics/node_modules/.bin/tsserver +2 -2
- package/__e2e__/fixtures/basics/package.json +3 -3
- package/package.json +1 -1
- package/src/astro-integration/config.ts +7 -1
- package/src/astro-integration/virtual.d.ts +8 -3
- package/src/astro-integration/vite-plugin-lightnet-config.ts +9 -3
- package/src/layouts/Page.astro +8 -4
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.
|
|
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.
|
|
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.
|
|
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.
|
|
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.
|
|
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.
|
|
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.
|
|
11
|
-
"lightnet": "^3.
|
|
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.
|
|
16
|
+
"typescript": "^5.8.3"
|
|
17
17
|
}
|
|
18
18
|
}
|
package/package.json
CHANGED
|
@@ -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
|
|
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/
|
|
17
|
-
const
|
|
18
|
-
export default
|
|
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
|
|
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
|
-
|
|
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
|
|
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
|
}
|
package/src/layouts/Page.astro
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
import { ClientRouter } from "astro:transitions"
|
|
3
|
-
import
|
|
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
|
-
{
|
|
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
|
|
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="
|
|
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>
|