@pyreon/zero 0.11.9 → 0.12.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/lib/font.js +20 -7
- package/lib/font.js.map +1 -1
- package/lib/image-plugin.js.map +1 -1
- package/lib/index.js +21 -7
- package/lib/index.js.map +1 -1
- package/lib/link.js +1 -0
- package/lib/link.js.map +1 -1
- package/lib/types/actions.d.ts +57 -0
- package/lib/types/actions.d.ts.map +1 -0
- package/lib/types/adapters/bun.d.ts +6 -0
- package/lib/types/adapters/bun.d.ts.map +1 -0
- package/lib/types/adapters/index.d.ts +10 -0
- package/lib/types/adapters/index.d.ts.map +1 -0
- package/lib/types/adapters/node.d.ts +6 -0
- package/lib/types/adapters/node.d.ts.map +1 -0
- package/lib/types/adapters/static.d.ts +7 -0
- package/lib/types/adapters/static.d.ts.map +1 -0
- package/lib/types/api-routes.d.ts +66 -0
- package/lib/types/api-routes.d.ts.map +1 -0
- package/lib/types/app.d.ts +24 -0
- package/lib/types/app.d.ts.map +1 -0
- package/lib/types/cache.d.ts +54 -0
- package/lib/types/cache.d.ts.map +1 -0
- package/lib/types/client.d.ts +19 -0
- package/lib/types/client.d.ts.map +1 -0
- package/lib/types/compression.d.ts +33 -0
- package/lib/types/compression.d.ts.map +1 -0
- package/lib/types/config.d.ts +18 -0
- package/lib/types/config.d.ts.map +1 -0
- package/lib/types/cors.d.ts +32 -0
- package/lib/types/cors.d.ts.map +1 -0
- package/lib/types/entry-server.d.ts +37 -0
- package/lib/types/entry-server.d.ts.map +1 -0
- package/lib/types/error-overlay.d.ts +6 -0
- package/lib/types/error-overlay.d.ts.map +1 -0
- package/lib/types/favicon.d.ts +43 -0
- package/lib/types/favicon.d.ts.map +1 -0
- package/lib/types/font.d.ts +119 -0
- package/lib/types/font.d.ts.map +1 -0
- package/lib/types/fs-router.d.ts +47 -0
- package/lib/types/fs-router.d.ts.map +1 -0
- package/lib/types/i18n-routing.d.ts +98 -0
- package/lib/types/i18n-routing.d.ts.map +1 -0
- package/lib/types/image-plugin.d.ts +79 -0
- package/lib/types/image-plugin.d.ts.map +1 -0
- package/lib/types/image.d.ts +51 -0
- package/lib/types/image.d.ts.map +1 -0
- package/lib/types/index.d.ts +46 -0
- package/lib/types/index.d.ts.map +1 -0
- package/lib/types/isr.d.ts +9 -0
- package/lib/types/isr.d.ts.map +1 -0
- package/lib/types/link.d.ts +127 -0
- package/lib/types/link.d.ts.map +1 -0
- package/lib/types/meta.d.ts +91 -0
- package/lib/types/meta.d.ts.map +1 -0
- package/lib/types/middleware.d.ts +35 -0
- package/lib/types/middleware.d.ts.map +1 -0
- package/lib/types/not-found.d.ts +7 -0
- package/lib/types/not-found.d.ts.map +1 -0
- package/lib/types/rate-limit.d.ts +34 -0
- package/lib/types/rate-limit.d.ts.map +1 -0
- package/lib/types/script.d.ts +35 -0
- package/lib/types/script.d.ts.map +1 -0
- package/lib/types/seo.d.ts +88 -0
- package/lib/types/seo.d.ts.map +1 -0
- package/lib/types/testing.d.ts +85 -0
- package/lib/types/testing.d.ts.map +1 -0
- package/lib/types/theme.d.ts +39 -0
- package/lib/types/theme.d.ts.map +1 -0
- package/lib/types/types.d.ts +111 -0
- package/lib/types/types.d.ts.map +1 -0
- package/lib/types/utils/use-intersection-observer.d.ts +10 -0
- package/lib/types/utils/use-intersection-observer.d.ts.map +1 -0
- package/lib/types/utils/with-headers.d.ts +6 -0
- package/lib/types/utils/with-headers.d.ts.map +1 -0
- package/lib/types/vite-plugin.d.ts +17 -0
- package/lib/types/vite-plugin.d.ts.map +1 -0
- package/package.json +10 -10
- package/src/favicon.ts +2 -2
- package/src/font.ts +32 -8
- package/src/image-plugin.ts +1 -1
- package/src/link.tsx +7 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pyreon/zero",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.12.0",
|
|
4
4
|
"description": "Pyreon Zero — zero-config full-stack framework powered by Pyreon and Vite",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "Vit Bokisch",
|
|
@@ -116,17 +116,17 @@
|
|
|
116
116
|
"lint": "oxlint ."
|
|
117
117
|
},
|
|
118
118
|
"dependencies": {
|
|
119
|
-
"@pyreon/core": "^0.
|
|
120
|
-
"@pyreon/head": "^0.
|
|
121
|
-
"@pyreon/meta": "^0.
|
|
122
|
-
"@pyreon/router": "^0.
|
|
123
|
-
"@pyreon/runtime-dom": "^0.
|
|
124
|
-
"@pyreon/runtime-server": "^0.
|
|
125
|
-
"@pyreon/server": "^0.
|
|
126
|
-
"@pyreon/vite-plugin": "^0.
|
|
119
|
+
"@pyreon/core": "^0.12.0",
|
|
120
|
+
"@pyreon/head": "^0.12.0",
|
|
121
|
+
"@pyreon/meta": "^0.12.0",
|
|
122
|
+
"@pyreon/router": "^0.12.0",
|
|
123
|
+
"@pyreon/runtime-dom": "^0.12.0",
|
|
124
|
+
"@pyreon/runtime-server": "^0.12.0",
|
|
125
|
+
"@pyreon/server": "^0.12.0",
|
|
126
|
+
"@pyreon/vite-plugin": "^0.12.0",
|
|
127
127
|
"vite": "^8.0.0"
|
|
128
128
|
},
|
|
129
129
|
"peerDependencies": {
|
|
130
|
-
"@pyreon/reactivity": "^0.
|
|
130
|
+
"@pyreon/reactivity": "^0.12.0"
|
|
131
131
|
}
|
|
132
132
|
}
|
package/src/favicon.ts
CHANGED
|
@@ -7,7 +7,7 @@ let sharpWarned = false
|
|
|
7
7
|
function warnSharpMissing() {
|
|
8
8
|
if (sharpWarned) return
|
|
9
9
|
sharpWarned = true
|
|
10
|
-
//
|
|
10
|
+
// oxlint-disable-next-line no-console
|
|
11
11
|
console.warn(
|
|
12
12
|
'\n[zero:favicon] sharp not installed — favicons will not be generated. Install for full support: bun add -D sharp\n',
|
|
13
13
|
)
|
|
@@ -211,7 +211,7 @@ export function faviconPlugin(config: FaviconPluginConfig): Plugin {
|
|
|
211
211
|
|
|
212
212
|
const sourcePath = join(root, config.source)
|
|
213
213
|
if (!existsSync(sourcePath)) {
|
|
214
|
-
//
|
|
214
|
+
// oxlint-disable-next-line no-console
|
|
215
215
|
console.warn(`[zero:favicon] Source not found: ${sourcePath}`)
|
|
216
216
|
return
|
|
217
217
|
}
|
package/src/font.ts
CHANGED
|
@@ -146,14 +146,38 @@ export function parseGoogleFamily(input: string): ResolvedFont {
|
|
|
146
146
|
}
|
|
147
147
|
}
|
|
148
148
|
|
|
149
|
-
// Static weights:
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
149
|
+
// Static weights — two formats:
|
|
150
|
+
// Simple: "wght@400;500;700"
|
|
151
|
+
// Tuples: "ital,wght@0,300;0,500;1,300;1,500" (ital_flag,weight pairs)
|
|
152
|
+
const afterAt = spec.split('@')[1]
|
|
153
|
+
if (afterAt) {
|
|
154
|
+
const entries = afterAt.split(';').filter(Boolean)
|
|
155
|
+
const weights = new Set<number>()
|
|
156
|
+
|
|
157
|
+
for (const entry of entries) {
|
|
158
|
+
if (entry.includes(',')) {
|
|
159
|
+
// Tuple format: "0,300" or "1,500" — last value is the weight
|
|
160
|
+
const parts = entry.split(',')
|
|
161
|
+
const weight = Number(parts[parts.length - 1])
|
|
162
|
+
if (weight > 0) weights.add(weight)
|
|
163
|
+
// Detect italic from tuple: "1,xxx" means italic
|
|
164
|
+
if (parts[0] === '1') italic = true
|
|
165
|
+
} else if (entry.includes('..')) {
|
|
166
|
+
// Variable range already handled above — skip
|
|
167
|
+
} else {
|
|
168
|
+
// Simple weight: "400"
|
|
169
|
+
const weight = Number(entry)
|
|
170
|
+
if (weight > 0) weights.add(weight)
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
if (weights.size > 0) {
|
|
175
|
+
return {
|
|
176
|
+
family,
|
|
177
|
+
italic,
|
|
178
|
+
variable: false,
|
|
179
|
+
weights: [...weights].sort((a, b) => a - b),
|
|
180
|
+
}
|
|
157
181
|
}
|
|
158
182
|
}
|
|
159
183
|
}
|
package/src/image-plugin.ts
CHANGED
|
@@ -7,7 +7,7 @@ let sharpWarned = false
|
|
|
7
7
|
function warnSharpMissing() {
|
|
8
8
|
if (sharpWarned) return
|
|
9
9
|
sharpWarned = true
|
|
10
|
-
//
|
|
10
|
+
// oxlint-disable-next-line no-console
|
|
11
11
|
console.warn(
|
|
12
12
|
'\n[zero:image] sharp not installed — images will not be optimized. Install for full support: bun add -D sharp\n',
|
|
13
13
|
)
|
package/src/link.tsx
CHANGED
|
@@ -30,6 +30,8 @@ export interface LinkProps {
|
|
|
30
30
|
style?: string
|
|
31
31
|
/** ARIA label. */
|
|
32
32
|
'aria-label'?: string
|
|
33
|
+
/** Additional click handler — called before navigation. Call e.preventDefault() to cancel. */
|
|
34
|
+
onClick?: ((e: MouseEvent) => void) | undefined
|
|
33
35
|
}
|
|
34
36
|
|
|
35
37
|
/** Props passed to a custom component via createLink. */
|
|
@@ -124,6 +126,11 @@ export function useLink(props: LinkProps): UseLinkReturn {
|
|
|
124
126
|
const strategy = props.prefetch ?? 'hover'
|
|
125
127
|
|
|
126
128
|
function handleClick(e: MouseEvent) {
|
|
129
|
+
// Call user's onClick first — they may call e.preventDefault()
|
|
130
|
+
if (props.onClick) {
|
|
131
|
+
;(props.onClick as (e: MouseEvent) => void)(e)
|
|
132
|
+
}
|
|
133
|
+
|
|
127
134
|
if (
|
|
128
135
|
e.defaultPrevented ||
|
|
129
136
|
e.button !== 0 ||
|