@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.
Files changed (82) hide show
  1. package/lib/font.js +20 -7
  2. package/lib/font.js.map +1 -1
  3. package/lib/image-plugin.js.map +1 -1
  4. package/lib/index.js +21 -7
  5. package/lib/index.js.map +1 -1
  6. package/lib/link.js +1 -0
  7. package/lib/link.js.map +1 -1
  8. package/lib/types/actions.d.ts +57 -0
  9. package/lib/types/actions.d.ts.map +1 -0
  10. package/lib/types/adapters/bun.d.ts +6 -0
  11. package/lib/types/adapters/bun.d.ts.map +1 -0
  12. package/lib/types/adapters/index.d.ts +10 -0
  13. package/lib/types/adapters/index.d.ts.map +1 -0
  14. package/lib/types/adapters/node.d.ts +6 -0
  15. package/lib/types/adapters/node.d.ts.map +1 -0
  16. package/lib/types/adapters/static.d.ts +7 -0
  17. package/lib/types/adapters/static.d.ts.map +1 -0
  18. package/lib/types/api-routes.d.ts +66 -0
  19. package/lib/types/api-routes.d.ts.map +1 -0
  20. package/lib/types/app.d.ts +24 -0
  21. package/lib/types/app.d.ts.map +1 -0
  22. package/lib/types/cache.d.ts +54 -0
  23. package/lib/types/cache.d.ts.map +1 -0
  24. package/lib/types/client.d.ts +19 -0
  25. package/lib/types/client.d.ts.map +1 -0
  26. package/lib/types/compression.d.ts +33 -0
  27. package/lib/types/compression.d.ts.map +1 -0
  28. package/lib/types/config.d.ts +18 -0
  29. package/lib/types/config.d.ts.map +1 -0
  30. package/lib/types/cors.d.ts +32 -0
  31. package/lib/types/cors.d.ts.map +1 -0
  32. package/lib/types/entry-server.d.ts +37 -0
  33. package/lib/types/entry-server.d.ts.map +1 -0
  34. package/lib/types/error-overlay.d.ts +6 -0
  35. package/lib/types/error-overlay.d.ts.map +1 -0
  36. package/lib/types/favicon.d.ts +43 -0
  37. package/lib/types/favicon.d.ts.map +1 -0
  38. package/lib/types/font.d.ts +119 -0
  39. package/lib/types/font.d.ts.map +1 -0
  40. package/lib/types/fs-router.d.ts +47 -0
  41. package/lib/types/fs-router.d.ts.map +1 -0
  42. package/lib/types/i18n-routing.d.ts +98 -0
  43. package/lib/types/i18n-routing.d.ts.map +1 -0
  44. package/lib/types/image-plugin.d.ts +79 -0
  45. package/lib/types/image-plugin.d.ts.map +1 -0
  46. package/lib/types/image.d.ts +51 -0
  47. package/lib/types/image.d.ts.map +1 -0
  48. package/lib/types/index.d.ts +46 -0
  49. package/lib/types/index.d.ts.map +1 -0
  50. package/lib/types/isr.d.ts +9 -0
  51. package/lib/types/isr.d.ts.map +1 -0
  52. package/lib/types/link.d.ts +127 -0
  53. package/lib/types/link.d.ts.map +1 -0
  54. package/lib/types/meta.d.ts +91 -0
  55. package/lib/types/meta.d.ts.map +1 -0
  56. package/lib/types/middleware.d.ts +35 -0
  57. package/lib/types/middleware.d.ts.map +1 -0
  58. package/lib/types/not-found.d.ts +7 -0
  59. package/lib/types/not-found.d.ts.map +1 -0
  60. package/lib/types/rate-limit.d.ts +34 -0
  61. package/lib/types/rate-limit.d.ts.map +1 -0
  62. package/lib/types/script.d.ts +35 -0
  63. package/lib/types/script.d.ts.map +1 -0
  64. package/lib/types/seo.d.ts +88 -0
  65. package/lib/types/seo.d.ts.map +1 -0
  66. package/lib/types/testing.d.ts +85 -0
  67. package/lib/types/testing.d.ts.map +1 -0
  68. package/lib/types/theme.d.ts +39 -0
  69. package/lib/types/theme.d.ts.map +1 -0
  70. package/lib/types/types.d.ts +111 -0
  71. package/lib/types/types.d.ts.map +1 -0
  72. package/lib/types/utils/use-intersection-observer.d.ts +10 -0
  73. package/lib/types/utils/use-intersection-observer.d.ts.map +1 -0
  74. package/lib/types/utils/with-headers.d.ts +6 -0
  75. package/lib/types/utils/with-headers.d.ts.map +1 -0
  76. package/lib/types/vite-plugin.d.ts +17 -0
  77. package/lib/types/vite-plugin.d.ts.map +1 -0
  78. package/package.json +10 -10
  79. package/src/favicon.ts +2 -2
  80. package/src/font.ts +32 -8
  81. package/src/image-plugin.ts +1 -1
  82. package/src/link.tsx +7 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pyreon/zero",
3
- "version": "0.11.9",
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.11.9",
120
- "@pyreon/head": "^0.11.9",
121
- "@pyreon/meta": "^0.11.9",
122
- "@pyreon/router": "^0.11.9",
123
- "@pyreon/runtime-dom": "^0.11.9",
124
- "@pyreon/runtime-server": "^0.11.9",
125
- "@pyreon/server": "^0.11.9",
126
- "@pyreon/vite-plugin": "^0.11.9",
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.11.9"
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
- // biome-ignore lint/suspicious/noConsole: intentional build-time warning
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
- // eslint-disable-next-line no-console
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: wght@400;500;700
150
- const weightMatch = spec.match(/wght@([\d;]+)/)
151
- if (weightMatch && weightMatch[1]) {
152
- return {
153
- family,
154
- italic,
155
- variable: false,
156
- weights: weightMatch[1].split(';').map(Number),
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
  }
@@ -7,7 +7,7 @@ let sharpWarned = false
7
7
  function warnSharpMissing() {
8
8
  if (sharpWarned) return
9
9
  sharpWarned = true
10
- // biome-ignore lint/suspicious/noConsole: intentional build-time warning
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 ||