@vezham/config 0.0.0-stage → 26.0.0-alpha.6

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 (173) hide show
  1. package/LICENSE +173 -0
  2. package/README.md +14 -2
  3. package/dist/index.d.ts +2 -0
  4. package/dist/index.d.ts.map +1 -0
  5. package/dist/index.js +0 -0
  6. package/dist/lib/deploy/cli.d.ts +3 -0
  7. package/dist/lib/deploy/cli.d.ts.map +1 -0
  8. package/dist/lib/deploy/cli.js +12 -0
  9. package/dist/lib/deploy/firebase.d.ts +3 -0
  10. package/dist/lib/deploy/firebase.d.ts.map +1 -0
  11. package/dist/lib/deploy/firebase.js +106 -0
  12. package/dist/lib/deploy/index.d.ts +4 -0
  13. package/dist/lib/deploy/index.d.ts.map +1 -0
  14. package/dist/lib/deploy/index.js +42 -0
  15. package/dist/lib/deploy/paths.d.ts +3 -0
  16. package/dist/lib/deploy/paths.d.ts.map +1 -0
  17. package/dist/lib/deploy/paths.js +6 -0
  18. package/dist/lib/deploy/presets.d.ts +5 -0
  19. package/dist/lib/deploy/presets.d.ts.map +1 -0
  20. package/dist/lib/deploy/presets.js +10 -0
  21. package/dist/lib/deploy/types.d.ts +97 -0
  22. package/dist/lib/deploy/types.d.ts.map +1 -0
  23. package/dist/lib/deploy/vercel.d.ts +3 -0
  24. package/dist/lib/deploy/vercel.d.ts.map +1 -0
  25. package/dist/lib/deploy/vercel.js +47 -0
  26. package/dist/lib/framework.d.ts +3 -0
  27. package/dist/lib/framework.d.ts.map +1 -0
  28. package/dist/lib/framework.js +7 -0
  29. package/dist/lib/i18n.d.ts +6 -0
  30. package/dist/lib/i18n.d.ts.map +1 -0
  31. package/dist/lib/i18n.js +11 -0
  32. package/dist/lib/integrations/next/index.d.ts +4 -0
  33. package/dist/lib/integrations/next/index.d.ts.map +1 -0
  34. package/dist/lib/integrations/next/index.js +29 -0
  35. package/dist/lib/integrations/playwright/index.d.ts +11 -0
  36. package/dist/lib/integrations/playwright/index.d.ts.map +1 -0
  37. package/dist/lib/integrations/playwright/index.js +77 -0
  38. package/dist/lib/integrations/playwright/test.d.ts +5 -0
  39. package/dist/lib/integrations/playwright/test.d.ts.map +1 -0
  40. package/dist/lib/integrations/playwright/test.js +23 -0
  41. package/dist/lib/integrations/vite/index.d.ts +12 -0
  42. package/dist/lib/integrations/vite/index.d.ts.map +1 -0
  43. package/dist/lib/integrations/vite/index.js +34 -0
  44. package/dist/lib/integrations/vite-lib/base.d.ts +3 -0
  45. package/dist/lib/integrations/vite-lib/base.d.ts.map +1 -0
  46. package/dist/lib/integrations/vite-lib/base.js +31 -0
  47. package/dist/lib/integrations/vite-lib/index.d.ts +3 -0
  48. package/dist/lib/integrations/vite-lib/index.d.ts.map +1 -0
  49. package/dist/lib/integrations/vite-lib/index.js +42 -0
  50. package/dist/lib/integrations/vite-lib/react.d.ts +3 -0
  51. package/dist/lib/integrations/vite-lib/react.d.ts.map +1 -0
  52. package/dist/lib/integrations/vite-lib/react.js +10 -0
  53. package/dist/lib/integrations/vitest/framework.d.ts +4 -0
  54. package/dist/lib/integrations/vitest/framework.d.ts.map +1 -0
  55. package/dist/lib/integrations/vitest/framework.js +5 -0
  56. package/dist/lib/integrations/vitest/frameworks/docs-plugins.d.ts +3 -0
  57. package/dist/lib/integrations/vitest/frameworks/docs-plugins.d.ts.map +1 -0
  58. package/dist/lib/integrations/vitest/frameworks/docs-plugins.js +27 -0
  59. package/dist/lib/integrations/vitest/frameworks/docs.d.ts +3 -0
  60. package/dist/lib/integrations/vitest/frameworks/docs.d.ts.map +1 -0
  61. package/dist/lib/integrations/vitest/frameworks/docs.js +5 -0
  62. package/dist/lib/integrations/vitest/frameworks/next.d.ts +3 -0
  63. package/dist/lib/integrations/vitest/frameworks/next.d.ts.map +1 -0
  64. package/dist/lib/integrations/vitest/frameworks/next.js +5 -0
  65. package/dist/lib/integrations/vitest/frameworks/react.d.ts +3 -0
  66. package/dist/lib/integrations/vitest/frameworks/react.d.ts.map +1 -0
  67. package/dist/lib/integrations/vitest/frameworks/react.js +5 -0
  68. package/dist/lib/integrations/vitest/index.d.ts +4 -0
  69. package/dist/lib/integrations/vitest/index.d.ts.map +1 -0
  70. package/dist/lib/integrations/vitest/index.js +4 -0
  71. package/dist/lib/integrations/vitest/setup/next.d.ts +2 -0
  72. package/dist/lib/integrations/vitest/setup/next.d.ts.map +1 -0
  73. package/dist/lib/integrations/vitest/setup/next.js +11 -0
  74. package/dist/lib/integrations/vitest/setup/react.d.ts +2 -0
  75. package/dist/lib/integrations/vitest/setup/react.d.ts.map +1 -0
  76. package/dist/lib/integrations/vitest/setup/react.js +36 -0
  77. package/dist/lib/integrations/vitest/shared.d.ts +3 -0
  78. package/dist/lib/integrations/vitest/shared.d.ts.map +1 -0
  79. package/dist/lib/integrations/vitest/shared.js +24 -0
  80. package/dist/lib/metadata/cli.d.ts +3 -0
  81. package/dist/lib/metadata/cli.d.ts.map +1 -0
  82. package/dist/lib/metadata/cli.js +13 -0
  83. package/dist/lib/metadata/env.d.ts +9 -0
  84. package/dist/lib/metadata/env.d.ts.map +1 -0
  85. package/dist/lib/metadata/env.js +36 -0
  86. package/dist/lib/metadata/html.d.ts +3 -0
  87. package/dist/lib/metadata/html.d.ts.map +1 -0
  88. package/dist/lib/metadata/html.js +96 -0
  89. package/dist/lib/metadata/index.d.ts +7 -0
  90. package/dist/lib/metadata/index.d.ts.map +1 -0
  91. package/dist/lib/metadata/index.js +61 -0
  92. package/dist/lib/metadata/next.d.ts +79 -0
  93. package/dist/lib/metadata/next.d.ts.map +1 -0
  94. package/dist/lib/metadata/next.js +106 -0
  95. package/dist/lib/metadata/public.d.ts +3 -0
  96. package/dist/lib/metadata/public.d.ts.map +1 -0
  97. package/dist/lib/metadata/public.js +107 -0
  98. package/dist/lib/metadata/render.d.ts +7 -0
  99. package/dist/lib/metadata/render.d.ts.map +1 -0
  100. package/dist/lib/metadata/render.js +37 -0
  101. package/dist/lib/metadata/runtime.d.ts +68 -0
  102. package/dist/lib/metadata/runtime.d.ts.map +1 -0
  103. package/dist/lib/metadata/runtime.js +134 -0
  104. package/dist/lib/metadata/tanstack.d.ts +71 -0
  105. package/dist/lib/metadata/tanstack.d.ts.map +1 -0
  106. package/dist/lib/metadata/tanstack.js +194 -0
  107. package/dist/lib/metadata/templates/not-found.html +224 -0
  108. package/dist/lib/metadata/templates/offline.html +210 -0
  109. package/dist/lib/metadata/types.d.ts +118 -0
  110. package/dist/lib/metadata/types.d.ts.map +1 -0
  111. package/dist/lib/navigation/app-menu.d.ts +2 -0
  112. package/dist/lib/navigation/app-menu.d.ts.map +1 -0
  113. package/dist/lib/navigation/app-menu.js +45 -0
  114. package/dist/lib/navigation/control-center.d.ts +2 -0
  115. package/dist/lib/navigation/control-center.d.ts.map +1 -0
  116. package/dist/lib/navigation/control-center.js +66 -0
  117. package/dist/lib/navigation/index.d.ts +5 -0
  118. package/dist/lib/navigation/index.d.ts.map +1 -0
  119. package/dist/lib/navigation/index.js +59 -0
  120. package/dist/lib/navigation/toolbar.d.ts +2 -0
  121. package/dist/lib/navigation/toolbar.d.ts.map +1 -0
  122. package/dist/lib/navigation/toolbar.js +78 -0
  123. package/dist/lib/presets/app/index.d.ts +21 -0
  124. package/dist/lib/presets/app/index.d.ts.map +1 -0
  125. package/dist/lib/presets/app/index.js +114 -0
  126. package/dist/lib/presets/cdn/index.d.ts +2 -0
  127. package/dist/lib/presets/cdn/index.d.ts.map +1 -0
  128. package/dist/lib/presets/cdn/index.js +2 -0
  129. package/dist/lib/presets/docs/cli.d.ts +3 -0
  130. package/dist/lib/presets/docs/cli.d.ts.map +1 -0
  131. package/dist/lib/presets/docs/cli.js +18 -0
  132. package/dist/lib/presets/docs/config.d.ts +40 -0
  133. package/dist/lib/presets/docs/config.d.ts.map +1 -0
  134. package/dist/lib/presets/docs/config.js +39 -0
  135. package/dist/lib/presets/docs/files.d.ts +2 -0
  136. package/dist/lib/presets/docs/files.d.ts.map +1 -0
  137. package/dist/lib/presets/docs/files.js +13 -0
  138. package/dist/lib/presets/docs/index.d.ts +7 -0
  139. package/dist/lib/presets/docs/index.d.ts.map +1 -0
  140. package/dist/lib/presets/docs/index.js +6 -0
  141. package/dist/lib/presets/docs/mdx-path.d.ts +7 -0
  142. package/dist/lib/presets/docs/mdx-path.d.ts.map +1 -0
  143. package/dist/lib/presets/docs/mdx-path.js +19 -0
  144. package/dist/lib/presets/docs/og-image.d.ts +9 -0
  145. package/dist/lib/presets/docs/og-image.d.ts.map +1 -0
  146. package/dist/lib/presets/docs/og-image.js +88 -0
  147. package/dist/lib/presets/docs/og-output.d.ts +5 -0
  148. package/dist/lib/presets/docs/og-output.d.ts.map +1 -0
  149. package/dist/lib/presets/docs/og-output.js +34 -0
  150. package/dist/lib/presets/docs/og.d.ts +9 -0
  151. package/dist/lib/presets/docs/og.d.ts.map +1 -0
  152. package/dist/lib/presets/docs/og.js +112 -0
  153. package/dist/lib/presets/docs/openapi.d.ts +3 -0
  154. package/dist/lib/presets/docs/openapi.d.ts.map +1 -0
  155. package/dist/lib/presets/docs/openapi.js +105 -0
  156. package/dist/lib/presets/docs/routes.d.ts +7 -0
  157. package/dist/lib/presets/docs/routes.d.ts.map +1 -0
  158. package/dist/lib/presets/docs/routes.js +109 -0
  159. package/dist/lib/presets/docs/types.d.ts +31 -0
  160. package/dist/lib/presets/docs/types.d.ts.map +1 -0
  161. package/dist/lib/presets/docs/vite.d.ts +11 -0
  162. package/dist/lib/presets/docs/vite.d.ts.map +1 -0
  163. package/dist/lib/presets/docs/vite.js +78 -0
  164. package/dist/lib/presets/files.d.ts +5 -0
  165. package/dist/lib/presets/files.d.ts.map +1 -0
  166. package/dist/lib/presets/files.js +21 -0
  167. package/dist/lib/presets/route-files.d.ts +22 -0
  168. package/dist/lib/presets/route-files.d.ts.map +1 -0
  169. package/dist/lib/presets/route-files.js +49 -0
  170. package/dist/lib/yaml-config.d.ts +2 -0
  171. package/dist/lib/yaml-config.d.ts.map +1 -0
  172. package/dist/lib/yaml-config.js +6 -0
  173. package/package.json +119 -3
@@ -0,0 +1,210 @@
1
+ <!doctype html>
2
+ <!-- {{generatedNotice}} -->
3
+ <html lang="en">
4
+ <head>
5
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
6
+ <meta http-equiv="X-UA-Compatible" content="IE=edge" />
7
+ <meta
8
+ name="viewport"
9
+ content="width=device-width, initial-scale=1.0, maximum-scale=1.5, user-scalable=1, shrink-to-fit=no" />
10
+ <meta name="author" content="{{author}}" />
11
+ <title>Offline | {{appName}}</title>
12
+ <style>
13
+ :root,
14
+ .light {
15
+ color-scheme: light;
16
+ --white: oklch(100% 0 0);
17
+ --snow: oklch(0.9911 0 0);
18
+ --eclipse: oklch(0.2103 0.0059 285.89);
19
+ --background: oklch(0.9702 0 0);
20
+ --foreground: var(--eclipse);
21
+ --muted: oklch(0.5517 0.0138 285.94);
22
+ --default: oklch(94% 0.001 286.375);
23
+ --default-foreground: var(--eclipse);
24
+ --accent: oklch(0.6204 0.195 253.83);
25
+ --accent-soft-foreground: color-mix(
26
+ in oklab,
27
+ var(--accent) 70%,
28
+ var(--foreground) 30%
29
+ );
30
+ --default-hover: color-mix(
31
+ in oklab,
32
+ var(--default) 96%,
33
+ var(--default-foreground) 4%
34
+ );
35
+ }
36
+
37
+ .dark,
38
+ [data-theme='dark'] {
39
+ color-scheme: dark;
40
+ --background: oklch(12% 0.005 285.823);
41
+ --foreground: var(--snow);
42
+ --muted: oklch(70.5% 0.015 286.067);
43
+ --default: oklch(27.4% 0.006 286.033);
44
+ --default-foreground: var(--snow);
45
+ --accent-soft-foreground: color-mix(
46
+ in oklab,
47
+ var(--accent) 80%,
48
+ var(--foreground) 30%
49
+ );
50
+ }
51
+
52
+ * {
53
+ box-sizing: border-box;
54
+ }
55
+
56
+ body {
57
+ background: var(--white);
58
+ color: var(--foreground);
59
+ font-family: ui-sans-serif, system-ui, sans-serif;
60
+ margin: 0;
61
+ }
62
+
63
+ .dark body,
64
+ [data-theme='dark'] body {
65
+ background: var(--background);
66
+ }
67
+
68
+ .dark .vx-offline__image,
69
+ [data-theme='dark'] .vx-offline__image {
70
+ filter: invert(1) hue-rotate(180deg);
71
+ }
72
+
73
+ .vx-offline {
74
+ align-items: center;
75
+ display: flex;
76
+ justify-content: center;
77
+ min-height: 100vh;
78
+ padding: 1.5rem;
79
+ text-align: left;
80
+ }
81
+
82
+ .empty-state {
83
+ padding: 0.5rem;
84
+ }
85
+
86
+ .vx-offline__content {
87
+ align-items: flex-start;
88
+ display: flex;
89
+ flex-direction: column;
90
+ gap: 0.75rem;
91
+ justify-content: center;
92
+ max-width: 36rem;
93
+ width: 100%;
94
+ }
95
+
96
+ .vx-offline__image {
97
+ height: auto;
98
+ margin-bottom: 0.75rem;
99
+ max-height: 16rem;
100
+ max-width: 100%;
101
+ object-fit: contain;
102
+ width: min(20rem, 70vw);
103
+ }
104
+
105
+ .typography {
106
+ color: var(--foreground);
107
+ margin: 0;
108
+ }
109
+
110
+ .typography--h2 {
111
+ font-size: 1.875rem;
112
+ font-weight: 600;
113
+ line-height: 2.25rem;
114
+ }
115
+
116
+ .typography--body {
117
+ font-size: 1rem;
118
+ line-height: 1.75rem;
119
+ }
120
+
121
+ .typography--color-muted {
122
+ color: var(--muted);
123
+ }
124
+
125
+ .button {
126
+ align-items: center;
127
+ border: 0;
128
+ border-radius: 1.5rem;
129
+ cursor: pointer;
130
+ display: inline-flex;
131
+ font: inherit;
132
+ font-size: 0.875rem;
133
+ font-weight: 500;
134
+ height: 2.25rem;
135
+ justify-content: center;
136
+ padding: 0 1rem;
137
+ text-decoration: none;
138
+ --button-bg: transparent;
139
+ --button-bg-hover: var(--button-bg);
140
+ --button-fg: currentcolor;
141
+ background: var(--button-bg);
142
+ color: var(--button-fg);
143
+ }
144
+
145
+ .button--secondary {
146
+ --button-bg: var(--default);
147
+ --button-bg-hover: var(--default-hover);
148
+ --button-fg: var(--accent-soft-foreground);
149
+ }
150
+
151
+ .button:hover {
152
+ background: var(--button-bg-hover);
153
+ }
154
+
155
+ .button:focus-visible {
156
+ outline: 2px solid var(--accent);
157
+ outline-offset: 2px;
158
+ }
159
+
160
+ @media (prefers-color-scheme: dark) {
161
+ :root:not(.light):not(.dark):not([data-theme]) {
162
+ color-scheme: dark;
163
+ --background: oklch(12% 0.005 285.823);
164
+ --foreground: var(--snow);
165
+ --muted: oklch(70.5% 0.015 286.067);
166
+ --default: oklch(27.4% 0.006 286.033);
167
+ --default-foreground: var(--snow);
168
+ --accent-soft-foreground: color-mix(
169
+ in oklab,
170
+ var(--accent) 80%,
171
+ var(--foreground) 30%
172
+ );
173
+ }
174
+
175
+ :root:not(.light):not(.dark):not([data-theme]) body {
176
+ background: var(--background);
177
+ }
178
+
179
+ :root:not(.light):not(.dark):not([data-theme]) .vx-offline__image {
180
+ filter: invert(1) hue-rotate(180deg);
181
+ }
182
+ }
183
+
184
+ @media only screen and (orientation: landscape) {
185
+ .vx-offline__image {
186
+ max-height: 11rem;
187
+ width: min(14rem, 30vw);
188
+ }
189
+ }
190
+ </style>
191
+ </head>
192
+ <body>
193
+ <main class="vx-offline">
194
+ <div class="empty-state">
195
+ <div class="vx-offline__content">
196
+ <!-- prettier-ignore -->
197
+ <img
198
+ class="vx-offline__image"
199
+ src="{{imageUrl}}"
200
+ alt="Offline" />
201
+ <h1 class="typography typography--h2">Oops! You're offline</h1>
202
+ <p class="typography typography--color-muted typography--body">
203
+ Please check your connection and try again.
204
+ </p>
205
+ <a class="button button--secondary" href="/">Back to Home</a>
206
+ </div>
207
+ </div>
208
+ </main>
209
+ </body>
210
+ </html>
@@ -0,0 +1,118 @@
1
+ import type { Framework } from '../framework';
2
+ import type { I18nConfig } from '../i18n';
3
+ import { type DocsConfig, type OgConfig } from '../presets/docs/config';
4
+ export type VxConfig = {
5
+ framework: Framework;
6
+ core: VxCoreConfig;
7
+ docs?: DocsConfig;
8
+ og?: OgConfig;
9
+ i18n?: I18nConfig;
10
+ branding: {
11
+ themeColor: string;
12
+ backgroundColor: string;
13
+ };
14
+ pwa: VxPwaConfig;
15
+ metadata: VxMetadataConfig;
16
+ };
17
+ type VxCoreConfig = {
18
+ id: string;
19
+ name: string;
20
+ shortName: string;
21
+ version: string;
22
+ description: string;
23
+ publisher: {
24
+ name: string;
25
+ url: string;
26
+ };
27
+ url: string;
28
+ };
29
+ type VxPwaConfig = {
30
+ display: string;
31
+ orientation: string;
32
+ scope: string;
33
+ startUrl: string;
34
+ categories: string[];
35
+ icons: VxIconSource;
36
+ screenshots: VxImage[];
37
+ shortcuts: VxShortcut[];
38
+ };
39
+ export type VxIcon = {
40
+ src: string;
41
+ sizes: string;
42
+ type: string;
43
+ };
44
+ type VxIconSet = {
45
+ path: string;
46
+ sizes: number[];
47
+ type: string;
48
+ };
49
+ export type VxIconSource = VxIcon[] | VxIconSet;
50
+ type VxImage = {
51
+ src: string;
52
+ sizes: string;
53
+ type: string;
54
+ };
55
+ type VxShortcut = {
56
+ name: string;
57
+ shortName: string;
58
+ url: string;
59
+ icons: VxIconSource;
60
+ };
61
+ type VxMetadataConfig = {
62
+ title: string;
63
+ keywords: string[];
64
+ theme: {
65
+ lightColor: string;
66
+ darkColor: string;
67
+ lightBackgroundColor: string;
68
+ darkBackgroundColor: string;
69
+ };
70
+ platforms: {
71
+ apple: {
72
+ mobileWebAppCapable: boolean;
73
+ webAppCapable: boolean;
74
+ touchIcon: string;
75
+ startupImages: VxStartupImageSource;
76
+ };
77
+ microsoft: {
78
+ startUrl: string;
79
+ };
80
+ };
81
+ social: {
82
+ openGraph: {
83
+ type: string;
84
+ image?: string;
85
+ };
86
+ twitter: {
87
+ creator: string;
88
+ site: string;
89
+ card: string;
90
+ image?: string;
91
+ };
92
+ };
93
+ };
94
+ export type VxStartupImage = {
95
+ colorScheme?: 'light' | 'dark';
96
+ device?: string;
97
+ width?: number;
98
+ height?: number;
99
+ pixelRatio?: number;
100
+ path?: string;
101
+ media?: string;
102
+ src?: string;
103
+ };
104
+ type VxStartupImageSet = {
105
+ path: string;
106
+ colorSchemes?: Array<'light' | 'dark'>;
107
+ sizes: VxStartupImage[];
108
+ };
109
+ export type VxStartupImageSource = VxStartupImage[] | VxStartupImageSet;
110
+ export type GenerateMetadataOptions = {
111
+ projectRoot?: string;
112
+ };
113
+ export type MetadataFile = {
114
+ path: string;
115
+ content: string;
116
+ };
117
+ export {};
118
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/lib/metadata/types.ts"],"names":[],"mappings":"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"}
@@ -0,0 +1,2 @@
1
+ export declare const validateAppMenu: (value: unknown, location: string) => void;
2
+ //# sourceMappingURL=app-menu.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"app-menu.d.ts","sourceRoot":"","sources":["../../../src/lib/navigation/app-menu.ts"],"names":[],"mappings":"AA8BA,eAAO,MAAM,eAAe,GAAI,OAAO,OAAO,EAAE,UAAU,MAAM,SAwB/D,CAAA"}
@@ -0,0 +1,45 @@
1
+ //#region src/lib/navigation/app-menu.ts
2
+ var MENU_FIELDS = new Set([
3
+ "key",
4
+ "label",
5
+ "icon",
6
+ "groups"
7
+ ]);
8
+ var ACTION_FIELDS = new Set([
9
+ "key",
10
+ "label",
11
+ "icon",
12
+ "shortcut"
13
+ ]);
14
+ var object = (value) => typeof value === "object" && value !== null && !Array.isArray(value);
15
+ var validateEntry = (value, fields, location, keys) => {
16
+ if (!object(value)) throw new Error(`${location} must be an object`);
17
+ for (const field of Object.keys(value)) if (!fields.has(field)) throw new Error(`Unknown field: ${location}.${field}`);
18
+ for (const field of [
19
+ "key",
20
+ "label",
21
+ "icon",
22
+ "shortcut"
23
+ ]) if (field === "key" || field === "label" || value[field] !== void 0) {
24
+ if (typeof value[field] !== "string" || !value[field].trim()) throw new Error(`${location}.${field} must be a non-empty string`);
25
+ }
26
+ const key = value.key;
27
+ if (keys.has(key)) throw new Error(`Duplicate app menu key: ${location}.${key}`);
28
+ keys.add(key);
29
+ return value;
30
+ };
31
+ var validateAppMenu = (value, location) => {
32
+ if (!Array.isArray(value)) throw new Error(`${location} must be an array`);
33
+ const menuKeys = /* @__PURE__ */ new Set();
34
+ const actionKeys = /* @__PURE__ */ new Set();
35
+ for (const entry of value) {
36
+ const menu = validateEntry(entry, MENU_FIELDS, location, menuKeys);
37
+ if (!Array.isArray(menu.groups) || !menu.groups.length) throw new Error(`${location}.${menu.key}.groups must be a non-empty array`);
38
+ for (const group of menu.groups) {
39
+ if (!Array.isArray(group) || !group.length) throw new Error(`${location}.${menu.key} groups must be non-empty arrays`);
40
+ for (const action of group) validateEntry(action, ACTION_FIELDS, `${location}.${menu.key}`, actionKeys);
41
+ }
42
+ }
43
+ };
44
+ //#endregion
45
+ export { validateAppMenu };
@@ -0,0 +1,2 @@
1
+ export declare const validateControlCenter: (value: unknown, location: string) => void;
2
+ //# sourceMappingURL=control-center.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"control-center.d.ts","sourceRoot":"","sources":["../../../src/lib/navigation/control-center.ts"],"names":[],"mappings":"AA6EA,eAAO,MAAM,qBAAqB,GAAI,OAAO,OAAO,EAAE,UAAU,MAAM,SAcrE,CAAA"}
@@ -0,0 +1,66 @@
1
+ //#region src/lib/navigation/control-center.ts
2
+ var TYPES = new Set([
3
+ "direction-toggle",
4
+ "appearance-toggle",
5
+ "appearance",
6
+ "theme",
7
+ "direction",
8
+ "language",
9
+ "preview-wifi",
10
+ "preview-bluetooth",
11
+ "preview-airdrop",
12
+ "preview-focus",
13
+ "preview-stage-manager",
14
+ "preview-mirroring",
15
+ "preview-media",
16
+ "preview-display",
17
+ "preview-sound",
18
+ "custom"
19
+ ]);
20
+ var FIELDS = new Set([
21
+ "id",
22
+ "type",
23
+ "span",
24
+ "label",
25
+ "description",
26
+ "editable",
27
+ "action"
28
+ ]);
29
+ var object = (value) => typeof value === "object" && value !== null && !Array.isArray(value);
30
+ var validateTileFields = (tile, location) => {
31
+ for (const [field, entry] of Object.entries(tile)) {
32
+ if (!FIELDS.has(field)) throw new Error(`Unknown field: ${location}.${field}`);
33
+ if (field === "editable") {
34
+ if (typeof entry !== "boolean") throw new Error(`${location}.editable must be a boolean`);
35
+ } else if (typeof entry !== "string" || !entry.trim()) throw new Error(`${location}.${field} must be a non-empty string`);
36
+ }
37
+ };
38
+ var validateTileAction = (tile, location) => {
39
+ if (tile.type === "custom") {
40
+ if (typeof tile.action !== "string" || !tile.action.trim()) throw new Error(`${location}.${tile.id}.action is required`);
41
+ } else if (tile.action !== void 0) throw new Error(`${location}.${tile.id}.action is only supported for custom tiles`);
42
+ };
43
+ var validateTile = (tile, location, ids) => {
44
+ if (!object(tile)) throw new Error(`${location}.tiles must contain objects`);
45
+ validateTileFields(tile, location);
46
+ if (typeof tile.id !== "string" || !tile.id.trim()) throw new Error(`${location}.id is required`);
47
+ if (tile.id === "edit-controls") throw new Error(`${location}.edit-controls is a reserved built-in action`);
48
+ if (ids.has(tile.id)) throw new Error(`Duplicate control center tile id: ${tile.id}`);
49
+ ids.add(tile.id);
50
+ if (typeof tile.type !== "string" || !TYPES.has(tile.type)) throw new Error(`Unknown control center tile type: ${tile.type}`);
51
+ if (![
52
+ "compact",
53
+ "standard",
54
+ "wide",
55
+ "full"
56
+ ].includes(String(tile.span))) throw new Error(`${location}.${tile.id}.span is invalid`);
57
+ validateTileAction(tile, location);
58
+ };
59
+ var validateControlCenter = (value, location) => {
60
+ if (!object(value) || Object.keys(value).some((key) => !["tiles", "editControls"].includes(key)) || !Array.isArray(value.tiles)) throw new Error(`${location} must contain a tiles array`);
61
+ if (value.editControls !== void 0 && typeof value.editControls !== "boolean") throw new Error(`${location}.editControls must be a boolean`);
62
+ const ids = /* @__PURE__ */ new Set();
63
+ for (const tile of value.tiles) validateTile(tile, location, ids);
64
+ };
65
+ //#endregion
66
+ export { validateControlCenter };
@@ -0,0 +1,5 @@
1
+ export declare const getNavigationFiles: (projectRoot: string) => {
2
+ path: string;
3
+ content: string;
4
+ }[];
5
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/lib/navigation/index.ts"],"names":[],"mappings":"AA8CA,eAAO,MAAM,kBAAkB,GAAI,aAAa,MAAM;;;GAmCrD,CAAA"}
@@ -0,0 +1,59 @@
1
+ import { readYamlConfig } from "../yaml-config.js";
2
+ import { validateAppMenu } from "./app-menu.js";
3
+ import { validateControlCenter } from "./control-center.js";
4
+ import { validateToolbar } from "./toolbar.js";
5
+ import { existsSync } from "node:fs";
6
+ import path from "node:path";
7
+ //#region src/lib/navigation/index.ts
8
+ var isObject = (value) => typeof value === "object" && value !== null && !Array.isArray(value);
9
+ var validateItems = (items, location) => {
10
+ if (!Array.isArray(items)) throw new Error(`${location} must be an array`);
11
+ const keys = /* @__PURE__ */ new Set();
12
+ for (const item of items) {
13
+ if (!isObject(item)) throw new Error(`${location} items must be objects`);
14
+ for (const field of ["key", "title"]) if (typeof item[field] !== "string" || !item[field].trim()) throw new Error(`${location}.${field} must be a non-empty string`);
15
+ const key = item.key;
16
+ if (keys.has(key)) throw new Error(`Duplicate navigation key: ${location}.${key}`);
17
+ keys.add(key);
18
+ for (const [field, value] of Object.entries(item)) if (field === "children") validateItems(value, `${location}.${key}.children`);
19
+ else if (field === "childrenDisplay") {
20
+ if (value !== "tabs" && value !== "sidebar") throw new Error(`${location}.${key}.childrenDisplay must be tabs or sidebar`);
21
+ } else if (field === "toolbar") validateToolbar(value, `${location}.${key}.toolbar`);
22
+ else if (![
23
+ "key",
24
+ "title",
25
+ "href",
26
+ "icon",
27
+ "iconActive"
28
+ ].includes(field)) throw new Error(`Unknown navigation field: ${location}.${key}.${field}`);
29
+ else if (typeof value !== "string") throw new Error(`${location}.${key}.${field} must be a string`);
30
+ }
31
+ };
32
+ var getNavigationFiles = (projectRoot) => {
33
+ const file = path.join(projectRoot, "vx.nav.yaml");
34
+ if (!existsSync(file)) return [];
35
+ const config = readYamlConfig(file);
36
+ if (!isObject(config) || Object.keys(config).some((key) => ![
37
+ "navigation",
38
+ "appMenu",
39
+ "controlCenter"
40
+ ].includes(key))) throw new Error(`${file} must contain navigation and optional appMenu or controlCenter`);
41
+ validateItems(config.navigation, `${file}.navigation`);
42
+ if (config.appMenu !== void 0) validateAppMenu(config.appMenu, `${file}.appMenu`);
43
+ if (config.controlCenter !== void 0) validateControlCenter(config.controlCenter, `${file}.controlCenter`);
44
+ return [{
45
+ path: path.join(projectRoot, "src/generated/navigation.ts"),
46
+ content: `// Generated from vx.nav.yaml. DO NOT EDIT.\nimport type { AppNavigationItem, AppMenuItem } from '@vezham/react'\nimport type { ControlCenterConfig } from '@vezham/react/control-center'\n\nexport const navigationItems = ${JSON.stringify(config.navigation, null, 2)} satisfies AppNavigationItem[]\n\nexport const appMenu = ${JSON.stringify(config.appMenu ?? [], null, 2)} satisfies AppMenuItem[]\n\nexport const controlCenter = ${JSON.stringify(config.controlCenter ?? { tiles: [] }, null, 2)} satisfies ControlCenterConfig\n
47
+ export const getNavigationChildren = (key: string) => {
48
+ const items: readonly AppNavigationItem[] = navigationItems
49
+ const item = items.find(item => item.key === key)
50
+ if (!item) {
51
+ throw new Error('Unknown navigation key: ' + key)
52
+ }
53
+ return 'children' in item && Array.isArray(item.children) ? item.children : []
54
+ }
55
+ `
56
+ }];
57
+ };
58
+ //#endregion
59
+ export { getNavigationFiles };
@@ -0,0 +1,2 @@
1
+ export declare const validateToolbar: (value: unknown, location: string) => void;
2
+ //# sourceMappingURL=toolbar.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"toolbar.d.ts","sourceRoot":"","sources":["../../../src/lib/navigation/toolbar.ts"],"names":[],"mappings":"AAmEA,eAAO,MAAM,eAAe,GAAI,OAAO,OAAO,EAAE,UAAU,MAAM,SAsB/D,CAAA"}
@@ -0,0 +1,78 @@
1
+ //#region src/lib/navigation/toolbar.ts
2
+ var ACTION_FIELDS = new Set([
3
+ "key",
4
+ "label",
5
+ "icon",
6
+ "children"
7
+ ]);
8
+ var VIEW_ACTION_FIELDS = new Set([
9
+ "key",
10
+ "label",
11
+ "icon",
12
+ "enabled"
13
+ ]);
14
+ var TOOLBAR_FIELDS = new Set([
15
+ "search",
16
+ "sync",
17
+ "filter",
18
+ "sort",
19
+ "view",
20
+ "menuActions",
21
+ "primaryAction"
22
+ ]);
23
+ var SEARCH_FIELDS = new Set(["label", "placeholder"]);
24
+ var VIEW_ACTION_KEYS = new Set(["grid", "list"]);
25
+ var object = (value) => typeof value === "object" && value !== null && !Array.isArray(value);
26
+ var validateFields = (value, fields, location) => {
27
+ for (const key of Object.keys(value)) if (!fields.has(key)) throw new Error(`Unknown field: ${location}.${key}`);
28
+ };
29
+ var validateString = (value, location) => {
30
+ if (typeof value !== "string" || !value.trim()) throw new Error(`${location} must be a non-empty string`);
31
+ };
32
+ var validateAction = (value, location) => {
33
+ if (!object(value)) throw new Error(`${location} must be an action object`);
34
+ validateFields(value, ACTION_FIELDS, location);
35
+ for (const field of [
36
+ "key",
37
+ "label",
38
+ "icon"
39
+ ]) validateString(value[field], `${location}.${field}`);
40
+ if (value.children !== void 0) validateActions(value.children, `${location}.children`);
41
+ };
42
+ var validateActions = (value, location, validate = validateAction) => {
43
+ if (!Array.isArray(value)) throw new Error(`${location} must be an array`);
44
+ const keys = /* @__PURE__ */ new Set();
45
+ for (const action of value) {
46
+ validate(action, location);
47
+ if (keys.has(action.key)) throw new Error(`Duplicate action key: ${location}.${action.key}`);
48
+ keys.add(action.key);
49
+ }
50
+ };
51
+ var validateViewAction = (value, location) => {
52
+ if (!object(value)) throw new Error(`${location} must contain action objects`);
53
+ validateFields(value, VIEW_ACTION_FIELDS, location);
54
+ for (const field of [
55
+ "key",
56
+ "label",
57
+ "icon"
58
+ ]) validateString(value[field], `${location}.${field}`);
59
+ if (typeof value.key !== "string" || !VIEW_ACTION_KEYS.has(value.key)) throw new Error(`Unknown view action key: ${location}.${value.key}`);
60
+ if (value.enabled !== void 0 && typeof value.enabled !== "boolean") throw new Error(`${location}.${value.key}.enabled must be a boolean`);
61
+ };
62
+ var validateToolbar = (value, location) => {
63
+ if (!object(value)) throw new Error(`${location} must be an object`);
64
+ validateFields(value, TOOLBAR_FIELDS, location);
65
+ if (value.search !== void 0 && typeof value.search !== "boolean") {
66
+ if (!object(value.search)) throw new Error(`${location}.search must be a boolean or an object`);
67
+ validateFields(value.search, SEARCH_FIELDS, `${location}.search`);
68
+ for (const [field, entry] of Object.entries(value.search)) validateString(entry, `${location}.search.${field}`);
69
+ }
70
+ if (value.sync !== void 0 && typeof value.sync !== "boolean") throw new Error(`${location}.sync must be a boolean`);
71
+ if (value.filter !== void 0 && typeof value.filter !== "boolean") throw new Error(`${location}.filter must be a boolean`);
72
+ if (value.sort !== void 0 && typeof value.sort !== "boolean") throw new Error(`${location}.sort must be a boolean`);
73
+ if (value.view !== void 0) validateActions(value.view, `${location}.view`, validateViewAction);
74
+ if (value.menuActions !== void 0) validateActions(value.menuActions, `${location}.menuActions`);
75
+ if (value.primaryAction !== void 0 && value.primaryAction !== false) validateAction(value.primaryAction, `${location}.primaryAction`);
76
+ };
77
+ //#endregion
78
+ export { validateToolbar };
@@ -0,0 +1,21 @@
1
+ import { type ViteConfigOverrides } from '../../integrations/vite';
2
+ export declare const defineConfig: (overrides?: ViteConfigOverrides) => import("vite").UserConfigExport;
3
+ export type PrerenderPage = {
4
+ path: string;
5
+ prerender?: {
6
+ outputPath: string;
7
+ };
8
+ };
9
+ export type RouteConfig = {
10
+ path: string;
11
+ prerender?: boolean | {
12
+ outputPath?: string;
13
+ };
14
+ source?: 'routes';
15
+ };
16
+ export type RouteInput = RouteConfig | string;
17
+ export type PrerenderPagesOptions = {
18
+ routes?: RouteInput[];
19
+ };
20
+ export declare const getPrerenderPages: (projectRoot?: string, { routes: extraRoutes }?: PrerenderPagesOptions) => PrerenderPage[];
21
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/lib/presets/app/index.ts"],"names":[],"mappings":"AAMA,OAAO,EAEL,KAAK,mBAAmB,EAGzB,MAAM,yBAAyB,CAAA;AAkIhC,eAAO,MAAM,YAAY,GAAI,YAAW,mBAAwB,oCAQ7D,CAAA;AAEH,MAAM,MAAM,aAAa,GAAG;IAC1B,IAAI,EAAE,MAAM,CAAA;IACZ,SAAS,CAAC,EAAE;QACV,UAAU,EAAE,MAAM,CAAA;KACnB,CAAA;CACF,CAAA;AAED,MAAM,MAAM,WAAW,GAAG;IACxB,IAAI,EAAE,MAAM,CAAA;IACZ,SAAS,CAAC,EACN,OAAO,GACP;QACE,UAAU,CAAC,EAAE,MAAM,CAAA;KACpB,CAAA;IACL,MAAM,CAAC,EAAE,QAAQ,CAAA;CAClB,CAAA;AAED,MAAM,MAAM,UAAU,GAAG,WAAW,GAAG,MAAM,CAAA;AAM7C,MAAM,MAAM,qBAAqB,GAAG;IAClC,MAAM,CAAC,EAAE,UAAU,EAAE,CAAA;CACtB,CAAA;AAuED,eAAO,MAAM,iBAAiB,GAC5B,oBAA2B,EAC3B,0BAA8B,qBAA0B,oBA0BzD,CAAA"}