appos 0.4.3-0 → 0.5.1-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/dist/exports/api/index.d.mts +3 -3
- package/dist/exports/api/index.mjs +34 -9
- package/dist/exports/api/workflows/index.d.mts +2 -2
- package/dist/exports/api/workflows/index.mjs +2 -2
- package/dist/exports/{auth-By0xx0MI.d.mts → auth-BCOIpGDO.d.mts} +325 -214
- package/dist/exports/cli/index.d.mts +105 -106
- package/dist/exports/cli/index.mjs +87 -13
- package/dist/exports/{constants-BePPc_yF.mjs → constants-BicCnEiJ.mjs} +7 -1
- package/dist/exports/{index-Bpo5QE7k.d.mts → index-CiuTp085.d.mts} +580 -614
- package/dist/exports/{openapi-crG3j4xx.mjs → openapi-uisUTLq7.mjs} +45 -102
- package/dist/exports/{send-email-Bgcdjy-e.mjs → send-email-CXxlkfFL.mjs} +1 -1
- package/dist/exports/{server-BlNxgHUc.mjs → server-CA4aI0U6.mjs} +6 -2
- package/dist/exports/storybook/index.d.ts +40 -0
- package/dist/exports/storybook/index.js +43 -0
- package/dist/exports/tests/api.d.mts +2 -2
- package/dist/exports/tests/api.mjs +3 -3
- package/dist/exports/vite/index.d.mts +19 -3
- package/dist/exports/vite/index.mjs +82 -6
- package/dist/exports/web/index.d.ts +2247 -700
- package/dist/exports/web/index.js +2445 -754
- package/dist/exports/web/routes.d.mts +41 -43
- package/dist/exports/web/ssr.d.mts +2 -2
- package/package.json +48 -31
- package/src/storybook/.storybook/main.ts +119 -0
- package/src/storybook/.storybook/manager.ts +75 -0
- package/src/storybook/.storybook/preview.tsx +76 -0
- package/src/storybook/components/ColorGrid.tsx +324 -0
- package/src/storybook/components/IconGallery.tsx +268 -0
- package/src/storybook/components/SpacingScale.tsx +236 -0
- package/src/storybook/components/TypographyScale.tsx +277 -0
- package/src/storybook/components/index.ts +3 -0
- package/src/storybook/docs/Introduction.mdx +29 -0
- package/src/storybook/docs/foundations/Colors.mdx +27 -0
- package/src/storybook/docs/foundations/Icons.mdx +26 -0
- package/src/storybook/docs/foundations/Spacing.mdx +23 -0
- package/src/storybook/docs/foundations/Typography.mdx +39 -0
- package/src/storybook/index.ts +147 -0
- package/src/storybook/shims/void-elements.js +18 -0
- package/src/web/client/auth-paths.ts +148 -0
- package/src/web/client/auth.ts +218 -0
- package/src/web/client/i18n.d.ts +9 -0
- package/src/web/client/i18n.ts +127 -0
- package/src/web/client/react-router.ts +84 -0
- package/src/web/hooks/index.ts +1 -0
- package/src/web/hooks/use-mobile.ts +19 -0
- package/src/web/index.ts +42 -0
- package/src/web/lib/colors.ts +220 -0
- package/src/web/lib/utils.ts +52 -0
- package/src/web/routes/auth/_layout.tsx +5 -11
- package/src/web/routes.ts +101 -0
- package/src/web/server/context.ts +14 -0
- package/src/web/server/render.ts +11 -0
- package/src/web/ssr.ts +17 -0
- package/src/web/ui/accordion.stories.tsx +183 -0
- package/src/web/ui/accordion.tsx +134 -0
- package/src/web/ui/alert-dialog.stories.tsx +215 -0
- package/src/web/ui/alert-dialog.tsx +328 -0
- package/src/web/ui/alert.stories.tsx +224 -0
- package/src/web/ui/alert.tsx +136 -0
- package/src/web/ui/animated-check.stories.tsx +200 -0
- package/src/web/ui/animated-check.tsx +98 -0
- package/src/web/ui/aspect-ratio.stories.tsx +204 -0
- package/src/web/ui/aspect-ratio.tsx +36 -0
- package/src/web/ui/auth/__mocks__/auth-context.tsx +273 -0
- package/src/web/ui/auth/auth-card.stories.tsx +295 -0
- package/src/web/ui/auth/auth-card.tsx +124 -0
- package/src/web/ui/auth/auth-layout.stories.tsx +330 -0
- package/src/web/ui/auth/auth-layout.tsx +269 -0
- package/src/web/ui/auth/captcha-widget.stories.tsx +200 -0
- package/src/web/ui/auth/captcha-widget.tsx +197 -0
- package/src/web/ui/auth/context.tsx +87 -0
- package/src/web/ui/auth/email-input.stories.tsx +167 -0
- package/src/web/ui/auth/email-input.tsx +84 -0
- package/src/web/ui/auth/forms/email-otp-form.tsx +377 -0
- package/src/web/ui/auth/forms/forgot-password-form.tsx +240 -0
- package/src/web/ui/auth/forms/index.ts +40 -0
- package/src/web/ui/auth/forms/login-form.tsx +486 -0
- package/src/web/ui/auth/forms/phone-otp-form.tsx +388 -0
- package/src/web/ui/auth/forms/reset-password-form.tsx +331 -0
- package/src/web/ui/auth/forms/signup-form.tsx +499 -0
- package/src/web/ui/auth/forms/two-factor-form.tsx +410 -0
- package/src/web/ui/auth/forms/verify-email-form.tsx +373 -0
- package/src/web/ui/auth/hooks.ts +266 -0
- package/src/web/ui/auth/index.ts +31 -0
- package/src/web/ui/auth/magic-link-form.tsx +191 -0
- package/src/web/ui/auth/otp-input.stories.tsx +199 -0
- package/src/web/ui/auth/otp-input.tsx +157 -0
- package/src/web/ui/auth/passkey-button.stories.tsx +115 -0
- package/src/web/ui/auth/passkey-button.tsx +113 -0
- package/src/web/ui/auth/passkey-register-button.stories.tsx +109 -0
- package/src/web/ui/auth/passkey-register-button.tsx +106 -0
- package/src/web/ui/auth/password-input.stories.tsx +287 -0
- package/src/web/ui/auth/password-input.tsx +306 -0
- package/src/web/ui/auth/phone-input.stories.tsx +160 -0
- package/src/web/ui/auth/phone-input.tsx +89 -0
- package/src/web/ui/auth/social-buttons.stories.tsx +217 -0
- package/src/web/ui/auth/social-buttons.tsx +196 -0
- package/src/web/ui/auth/sso-button.stories.tsx +160 -0
- package/src/web/ui/auth/sso-button.tsx +108 -0
- package/src/web/ui/auth/trust-signals.stories.tsx +208 -0
- package/src/web/ui/auth/trust-signals.tsx +260 -0
- package/src/web/ui/avatar.stories.tsx +302 -0
- package/src/web/ui/avatar.tsx +189 -0
- package/src/web/ui/badge.stories.tsx +225 -0
- package/src/web/ui/badge.tsx +66 -0
- package/src/web/ui/brand.stories.tsx +266 -0
- package/src/web/ui/brand.tsx +162 -0
- package/src/web/ui/breadcrumb.stories.tsx +271 -0
- package/src/web/ui/breadcrumb.tsx +214 -0
- package/src/web/ui/button-group.stories.tsx +251 -0
- package/src/web/ui/button-group.tsx +87 -0
- package/src/web/ui/button.stories.tsx +264 -0
- package/src/web/ui/button.tsx +120 -0
- package/src/web/ui/calendar.stories.tsx +235 -0
- package/src/web/ui/calendar.tsx +221 -0
- package/src/web/ui/card.stories.tsx +262 -0
- package/src/web/ui/card.tsx +199 -0
- package/src/web/ui/carousel.stories.tsx +244 -0
- package/src/web/ui/carousel.tsx +241 -0
- package/src/web/ui/chart.stories.tsx +833 -0
- package/src/web/ui/chart.tsx +390 -0
- package/src/web/ui/checkbox.stories.tsx +208 -0
- package/src/web/ui/checkbox.tsx +39 -0
- package/src/web/ui/collapsible.stories.tsx +239 -0
- package/src/web/ui/collapsible.tsx +21 -0
- package/src/web/ui/command.stories.tsx +291 -0
- package/src/web/ui/command.tsx +189 -0
- package/src/web/ui/context-menu.stories.tsx +255 -0
- package/src/web/ui/context-menu.tsx +263 -0
- package/src/web/ui/dialog.stories.tsx +263 -0
- package/src/web/ui/dialog.tsx +273 -0
- package/src/web/ui/drawer.stories.tsx +299 -0
- package/src/web/ui/drawer.tsx +130 -0
- package/src/web/ui/dropdown-menu.stories.tsx +320 -0
- package/src/web/ui/dropdown-menu.tsx +263 -0
- package/src/web/ui/empty.stories.tsx +204 -0
- package/src/web/ui/empty.tsx +101 -0
- package/src/web/ui/error-page.stories.tsx +181 -0
- package/src/web/ui/error-page.tsx +136 -0
- package/src/web/ui/field.stories.tsx +364 -0
- package/src/web/ui/field.tsx +252 -0
- package/src/web/ui/globals.css +3 -0
- package/src/web/ui/hover-card.stories.tsx +261 -0
- package/src/web/ui/hover-card.tsx +50 -0
- package/src/web/ui/index.ts +55 -0
- package/src/web/ui/input-group.stories.tsx +290 -0
- package/src/web/ui/input-group.tsx +157 -0
- package/src/web/ui/input-otp.stories.tsx +235 -0
- package/src/web/ui/input-otp.tsx +86 -0
- package/src/web/ui/input.stories.tsx +205 -0
- package/src/web/ui/input.tsx +30 -0
- package/src/web/ui/item.stories.tsx +348 -0
- package/src/web/ui/item.tsx +200 -0
- package/src/web/ui/kbd.stories.tsx +236 -0
- package/src/web/ui/kbd.tsx +27 -0
- package/src/web/ui/label.stories.tsx +180 -0
- package/src/web/ui/label.tsx +32 -0
- package/src/web/ui/locales/en/ui.json +13 -30
- package/src/web/ui/locales/zh-CN/ui.json +17 -34
- package/src/web/ui/locales/zh-TW/ui.json +17 -34
- package/src/web/ui/menubar.stories.tsx +385 -0
- package/src/web/ui/menubar.tsx +273 -0
- package/src/web/ui/navigation-menu.stories.tsx +361 -0
- package/src/web/ui/navigation-menu.tsx +168 -0
- package/src/web/ui/pagination.stories.tsx +312 -0
- package/src/web/ui/pagination.tsx +221 -0
- package/src/web/ui/popover.stories.tsx +315 -0
- package/src/web/ui/popover.tsx +89 -0
- package/src/web/ui/progress.stories.tsx +239 -0
- package/src/web/ui/progress.tsx +128 -0
- package/src/web/ui/radio-group.stories.tsx +315 -0
- package/src/web/ui/radio-group.tsx +38 -0
- package/src/web/ui/resizable.stories.tsx +304 -0
- package/src/web/ui/resizable.tsx +53 -0
- package/src/web/ui/scroll-area.stories.tsx +276 -0
- package/src/web/ui/scroll-area.tsx +53 -0
- package/src/web/ui/select.stories.tsx +314 -0
- package/src/web/ui/select.tsx +312 -0
- package/src/web/ui/separator.stories.tsx +246 -0
- package/src/web/ui/separator.tsx +36 -0
- package/src/web/ui/sheet.stories.tsx +417 -0
- package/src/web/ui/sheet.tsx +133 -0
- package/src/web/ui/sidebar.stories.tsx +402 -0
- package/src/web/ui/sidebar.tsx +723 -0
- package/src/web/ui/skeleton.stories.tsx +235 -0
- package/src/web/ui/skeleton.tsx +26 -0
- package/src/web/ui/slider.stories.tsx +294 -0
- package/src/web/ui/slider.tsx +75 -0
- package/src/web/ui/sonner.stories.tsx +279 -0
- package/src/web/ui/sonner.tsx +46 -0
- package/src/web/ui/spinner.stories.tsx +204 -0
- package/src/web/ui/spinner.tsx +28 -0
- package/src/web/ui/switch.stories.tsx +285 -0
- package/src/web/ui/switch.tsx +43 -0
- package/src/web/ui/table.stories.tsx +362 -0
- package/src/web/ui/table.tsx +115 -0
- package/src/web/ui/tabs.stories.tsx +401 -0
- package/src/web/ui/tabs.tsx +136 -0
- package/src/web/ui/textarea.stories.tsx +272 -0
- package/src/web/ui/textarea.tsx +28 -0
- package/src/web/ui/toggle-group.stories.tsx +334 -0
- package/src/web/ui/toggle-group.tsx +88 -0
- package/src/web/ui/toggle.stories.tsx +264 -0
- package/src/web/ui/toggle.tsx +57 -0
- package/src/web/ui/tooltip.stories.tsx +342 -0
- package/src/web/ui/tooltip.tsx +116 -0
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { t as defineAppContext } from "./app-context-LF4QmPUC.mjs";
|
|
2
|
-
import { a as DATABASES_DIR,
|
|
2
|
+
import { a as DATABASES_DIR, c as FILE_EXT, m as ROUTES_DIR, p as PUBLIC_DIR, t as APPOS_DIR } from "./constants-BicCnEiJ.mjs";
|
|
3
3
|
import { z } from "zod";
|
|
4
4
|
import { getTableName, sql } from "drizzle-orm";
|
|
5
5
|
import { basename, join, resolve } from "node:path";
|
|
@@ -235,6 +235,9 @@ var ui_default$2 = {
|
|
|
235
235
|
"passwordMismatch": "Passwords do not match",
|
|
236
236
|
"nameRequired": "Name is required",
|
|
237
237
|
"nameMax": "Name must be less than {{max}} characters",
|
|
238
|
+
"usernameMin": "Username must be at least {{min}} characters",
|
|
239
|
+
"usernameMax": "Username must be less than {{max}} characters",
|
|
240
|
+
"usernameFormat": "Username can only contain letters, numbers, hyphens, and underscores",
|
|
238
241
|
"codeLength": "Code must be {{length}} digits",
|
|
239
242
|
"codeDigitsOnly": "Code must contain only numbers",
|
|
240
243
|
"backupCodeRequired": "Backup code is required",
|
|
@@ -273,7 +276,8 @@ var ui_default$2 = {
|
|
|
273
276
|
"requestNewLink": "Request new link",
|
|
274
277
|
"continueWith": "Continue with {{provider}}",
|
|
275
278
|
"passkeyFailed": "Passkey authentication failed",
|
|
276
|
-
"backButton": "Back"
|
|
279
|
+
"backButton": "Back",
|
|
280
|
+
"lastUsed": "Last used"
|
|
277
281
|
},
|
|
278
282
|
"login": {
|
|
279
283
|
"title": "Welcome back",
|
|
@@ -288,13 +292,13 @@ var ui_default$2 = {
|
|
|
288
292
|
"signUp": "Sign up",
|
|
289
293
|
"orContinueWith": "or continue with",
|
|
290
294
|
"orSignInWith": "or sign in with email",
|
|
291
|
-
"emailVerified": "Your email has been verified. Please sign in to continue.",
|
|
292
295
|
"emailNotVerifiedDescription": "Your email address has not been verified yet. Please check your inbox for the verification email or click below to request a new one."
|
|
293
296
|
},
|
|
294
297
|
"signup": {
|
|
295
298
|
"title": "Create an account",
|
|
296
299
|
"description": "Enter your details to get started",
|
|
297
300
|
"name": "Name",
|
|
301
|
+
"username": "Username",
|
|
298
302
|
"email": "Email",
|
|
299
303
|
"password": "Password",
|
|
300
304
|
"submit": "Create account",
|
|
@@ -365,12 +369,6 @@ var ui_default$2 = {
|
|
|
365
369
|
"backupCode": "Backup code",
|
|
366
370
|
"backupPlaceholder": "Enter backup code"
|
|
367
371
|
},
|
|
368
|
-
"social": {
|
|
369
|
-
"google": "Google",
|
|
370
|
-
"github": "GitHub",
|
|
371
|
-
"apple": "Apple",
|
|
372
|
-
"facebook": "Facebook"
|
|
373
|
-
},
|
|
374
372
|
"passkey": {
|
|
375
373
|
"signIn": "Sign in with passkey",
|
|
376
374
|
"register": "Add passkey",
|
|
@@ -381,7 +379,8 @@ var ui_default$2 = {
|
|
|
381
379
|
"submitting": "Sending...",
|
|
382
380
|
"successTitle": "Check your email",
|
|
383
381
|
"successDescription": "We've sent a magic link to {{email}}. Click the link to sign in.",
|
|
384
|
-
"sendAnother": "Send another link"
|
|
382
|
+
"sendAnother": "Send another link",
|
|
383
|
+
"tryDifferentEmail": "Try a different email"
|
|
385
384
|
},
|
|
386
385
|
"sso": { "submit": "Continue with SSO" },
|
|
387
386
|
"phoneOtp": {
|
|
@@ -407,18 +406,10 @@ var ui_default$2 = {
|
|
|
407
406
|
"verify": "Verify",
|
|
408
407
|
"verifying": "Verifying...",
|
|
409
408
|
"resendIn": "Resend in {{seconds}}s",
|
|
410
|
-
"invalid": "Invalid code"
|
|
411
|
-
"expired": "Code expired"
|
|
409
|
+
"invalid": "Invalid code"
|
|
412
410
|
},
|
|
413
411
|
"error": {
|
|
414
|
-
"title": "Authentication Error",
|
|
415
|
-
"genericMessage": "Something went wrong during authentication",
|
|
416
|
-
"tryAgain": "Try again",
|
|
417
|
-
"oauthFailed": "OAuth authentication failed",
|
|
418
|
-
"ssoDomainFailed": "Domain verification failed",
|
|
419
|
-
"sessionExpired": "Session expired. Please try again.",
|
|
420
412
|
"accessDenied": "Access was denied. Please try again.",
|
|
421
|
-
"providerFailed": "{{provider}} login failed",
|
|
422
413
|
"invalidRequest": "Invalid request. Please try again.",
|
|
423
414
|
"unauthorizedClient": "Unauthorized client. Please contact support.",
|
|
424
415
|
"serverError": "Server error. Please try again later.",
|
|
@@ -454,23 +445,13 @@ var ui_default$2 = {
|
|
|
454
445
|
"featureAudit": "Complete audit logs",
|
|
455
446
|
"errors": {
|
|
456
447
|
"invalidCredentials": "Invalid email or password",
|
|
457
|
-
"
|
|
458
|
-
"emailInvalid": "Please enter a valid email address",
|
|
459
|
-
"passwordRequired": "Password is required",
|
|
460
|
-
"passwordMin": "Password must be at least 8 characters",
|
|
461
|
-
"passwordMax": "Password must be less than 128 characters",
|
|
462
|
-
"passwordMismatch": "Passwords do not match",
|
|
463
|
-
"nameRequired": "Name is required",
|
|
464
|
-
"nameMax": "Name must be less than 100 characters",
|
|
465
|
-
"codeRequired": "Verification code is required",
|
|
466
|
-
"codeInvalid": "Code must be 6 digits",
|
|
467
|
-
"codeDigitsOnly": "Code must contain only numbers",
|
|
468
|
-
"backupCodeRequired": "Backup code is required",
|
|
448
|
+
"codeInvalid": "Invalid verification code",
|
|
469
449
|
"backupCodeInvalid": "Invalid backup code",
|
|
470
450
|
"emailRequiredResend": "Email address is required to resend verification",
|
|
471
451
|
"generic": "An error occurred"
|
|
472
452
|
}
|
|
473
|
-
}
|
|
453
|
+
},
|
|
454
|
+
captcha: { "loading": "Loading verification..." }
|
|
474
455
|
};
|
|
475
456
|
|
|
476
457
|
//#endregion
|
|
@@ -485,6 +466,9 @@ var ui_default$1 = {
|
|
|
485
466
|
"passwordMismatch": "两次输入的密码不一致",
|
|
486
467
|
"nameRequired": "请输入姓名",
|
|
487
468
|
"nameMax": "姓名不能超过 {{max}} 个字符",
|
|
469
|
+
"usernameMin": "用户名至少需要 {{min}} 个字符",
|
|
470
|
+
"usernameMax": "用户名不能超过 {{max}} 个字符",
|
|
471
|
+
"usernameFormat": "用户名只能包含字母、数字、连字符和下划线",
|
|
488
472
|
"codeLength": "验证码必须是 {{length}} 位数字",
|
|
489
473
|
"codeDigitsOnly": "验证码只能包含数字",
|
|
490
474
|
"backupCodeRequired": "请输入备用码",
|
|
@@ -523,7 +507,8 @@ var ui_default$1 = {
|
|
|
523
507
|
"requestNewLink": "申请新链接",
|
|
524
508
|
"continueWith": "使用 {{provider}} 继续",
|
|
525
509
|
"passkeyFailed": "通行密钥认证失败",
|
|
526
|
-
"backButton": "返回"
|
|
510
|
+
"backButton": "返回",
|
|
511
|
+
"lastUsed": "上次使用"
|
|
527
512
|
},
|
|
528
513
|
"login": {
|
|
529
514
|
"title": "欢迎回来",
|
|
@@ -538,13 +523,13 @@ var ui_default$1 = {
|
|
|
538
523
|
"signUp": "注册",
|
|
539
524
|
"orContinueWith": "或继续使用",
|
|
540
525
|
"orSignInWith": "或使用邮箱登录",
|
|
541
|
-
"emailVerified": "您的邮箱已验证,请登录以继续。",
|
|
542
526
|
"emailNotVerifiedDescription": "您的邮箱地址尚未验证。请查看收件箱中的验证邮件,或点击下方按钮申请新的验证邮件。"
|
|
543
527
|
},
|
|
544
528
|
"signup": {
|
|
545
529
|
"title": "创建账户",
|
|
546
530
|
"description": "输入您的信息以开始使用",
|
|
547
531
|
"name": "姓名",
|
|
532
|
+
"username": "用户名",
|
|
548
533
|
"email": "电子邮件",
|
|
549
534
|
"password": "密码",
|
|
550
535
|
"submit": "创建账户",
|
|
@@ -615,12 +600,6 @@ var ui_default$1 = {
|
|
|
615
600
|
"backupCode": "备用码",
|
|
616
601
|
"backupPlaceholder": "输入备用码"
|
|
617
602
|
},
|
|
618
|
-
"social": {
|
|
619
|
-
"google": "谷歌",
|
|
620
|
-
"github": "GitHub",
|
|
621
|
-
"apple": "苹果",
|
|
622
|
-
"facebook": "脸书"
|
|
623
|
-
},
|
|
624
603
|
"passkey": {
|
|
625
604
|
"signIn": "使用通行密钥登录",
|
|
626
605
|
"register": "添加通行密钥",
|
|
@@ -631,7 +610,8 @@ var ui_default$1 = {
|
|
|
631
610
|
"submitting": "发送中...",
|
|
632
611
|
"successTitle": "请查收邮件",
|
|
633
612
|
"successDescription": "我们已向 {{email}} 发送登录链接,点击链接即可登录。",
|
|
634
|
-
"sendAnother": "重新发送链接"
|
|
613
|
+
"sendAnother": "重新发送链接",
|
|
614
|
+
"tryDifferentEmail": "使用其他邮箱"
|
|
635
615
|
},
|
|
636
616
|
"sso": { "submit": "使用 SSO 继续" },
|
|
637
617
|
"phoneOtp": {
|
|
@@ -657,22 +637,14 @@ var ui_default$1 = {
|
|
|
657
637
|
"verify": "验证",
|
|
658
638
|
"verifying": "验证中...",
|
|
659
639
|
"resendIn": "{{seconds}}秒后重发",
|
|
660
|
-
"invalid": "验证码无效"
|
|
661
|
-
"expired": "验证码已过期"
|
|
640
|
+
"invalid": "验证码无效"
|
|
662
641
|
},
|
|
663
642
|
"error": {
|
|
664
|
-
"title": "认证错误",
|
|
665
|
-
"genericMessage": "认证过程中发生错误",
|
|
666
|
-
"tryAgain": "重试",
|
|
667
|
-
"oauthFailed": "OAuth 认证失败",
|
|
668
|
-
"ssoDomainFailed": "域名验证失败",
|
|
669
|
-
"sessionExpired": "会话已过期,请重试",
|
|
670
643
|
"accessDenied": "访问被拒绝,请重试",
|
|
671
|
-
"
|
|
672
|
-
"
|
|
673
|
-
"
|
|
674
|
-
"
|
|
675
|
-
"generic": "认证错误,请重试。"
|
|
644
|
+
"invalidRequest": "无效请求,请重试",
|
|
645
|
+
"unauthorizedClient": "未授权的客户端,请联系支持",
|
|
646
|
+
"serverError": "服务器错误,请稍后再试",
|
|
647
|
+
"generic": "认证错误,请重试"
|
|
676
648
|
},
|
|
677
649
|
"password": {
|
|
678
650
|
"weak": "弱",
|
|
@@ -704,23 +676,13 @@ var ui_default$1 = {
|
|
|
704
676
|
"featureAudit": "完整审计日志",
|
|
705
677
|
"errors": {
|
|
706
678
|
"invalidCredentials": "电子邮件或密码错误",
|
|
707
|
-
"
|
|
708
|
-
"emailInvalid": "请输入有效的电子邮件地址",
|
|
709
|
-
"passwordRequired": "请输入密码",
|
|
710
|
-
"passwordMin": "密码至少需要8个字符",
|
|
711
|
-
"passwordMax": "密码不能超过128个字符",
|
|
712
|
-
"passwordMismatch": "两次输入的密码不一致",
|
|
713
|
-
"nameRequired": "请输入姓名",
|
|
714
|
-
"nameMax": "姓名不能超过100个字符",
|
|
715
|
-
"codeRequired": "请输入验证码",
|
|
716
|
-
"codeInvalid": "验证码必须是6位数字",
|
|
717
|
-
"codeDigitsOnly": "验证码只能包含数字",
|
|
718
|
-
"backupCodeRequired": "请输入备用码",
|
|
679
|
+
"codeInvalid": "验证码无效",
|
|
719
680
|
"backupCodeInvalid": "无效的备用码",
|
|
720
681
|
"emailRequiredResend": "需要电子邮件地址才能重新发送验证",
|
|
721
682
|
"generic": "发生错误"
|
|
722
683
|
}
|
|
723
|
-
}
|
|
684
|
+
},
|
|
685
|
+
captcha: { "loading": "正在加载验证..." }
|
|
724
686
|
};
|
|
725
687
|
|
|
726
688
|
//#endregion
|
|
@@ -735,6 +697,9 @@ var ui_default = {
|
|
|
735
697
|
"passwordMismatch": "兩次輸入的密碼不一致",
|
|
736
698
|
"nameRequired": "請輸入姓名",
|
|
737
699
|
"nameMax": "姓名不能超過 {{max}} 個字元",
|
|
700
|
+
"usernameMin": "使用者名稱至少需要 {{min}} 個字元",
|
|
701
|
+
"usernameMax": "使用者名稱不能超過 {{max}} 個字元",
|
|
702
|
+
"usernameFormat": "使用者名稱只能包含字母、數字、連字號和底線",
|
|
738
703
|
"codeLength": "驗證碼必須是 {{length}} 位數字",
|
|
739
704
|
"codeDigitsOnly": "驗證碼只能包含數字",
|
|
740
705
|
"backupCodeRequired": "請輸入備用碼",
|
|
@@ -773,7 +738,8 @@ var ui_default = {
|
|
|
773
738
|
"requestNewLink": "申請新連結",
|
|
774
739
|
"continueWith": "使用 {{provider}} 繼續",
|
|
775
740
|
"passkeyFailed": "通行金鑰認證失敗",
|
|
776
|
-
"backButton": "返回"
|
|
741
|
+
"backButton": "返回",
|
|
742
|
+
"lastUsed": "上次使用"
|
|
777
743
|
},
|
|
778
744
|
"login": {
|
|
779
745
|
"title": "歡迎回來",
|
|
@@ -788,13 +754,13 @@ var ui_default = {
|
|
|
788
754
|
"signUp": "註冊",
|
|
789
755
|
"orContinueWith": "或繼續使用",
|
|
790
756
|
"orSignInWith": "或使用郵箱登入",
|
|
791
|
-
"emailVerified": "您的郵箱已驗證,請登入以繼續。",
|
|
792
757
|
"emailNotVerifiedDescription": "您的郵箱地址尚未驗證。請查看收件匣中的驗證郵件,或點擊下方按鈕申請新的驗證郵件。"
|
|
793
758
|
},
|
|
794
759
|
"signup": {
|
|
795
760
|
"title": "建立帳戶",
|
|
796
761
|
"description": "輸入您的資訊以開始使用",
|
|
797
762
|
"name": "姓名",
|
|
763
|
+
"username": "使用者名稱",
|
|
798
764
|
"email": "電子郵件",
|
|
799
765
|
"password": "密碼",
|
|
800
766
|
"submit": "建立帳戶",
|
|
@@ -865,12 +831,6 @@ var ui_default = {
|
|
|
865
831
|
"backupCode": "備用碼",
|
|
866
832
|
"backupPlaceholder": "輸入備用碼"
|
|
867
833
|
},
|
|
868
|
-
"social": {
|
|
869
|
-
"google": "Google",
|
|
870
|
-
"github": "GitHub",
|
|
871
|
-
"apple": "Apple",
|
|
872
|
-
"facebook": "Facebook"
|
|
873
|
-
},
|
|
874
834
|
"passkey": {
|
|
875
835
|
"signIn": "使用通行金鑰登入",
|
|
876
836
|
"register": "新增通行金鑰",
|
|
@@ -881,7 +841,8 @@ var ui_default = {
|
|
|
881
841
|
"submitting": "發送中...",
|
|
882
842
|
"successTitle": "請查收郵件",
|
|
883
843
|
"successDescription": "我們已向 {{email}} 發送登入連結,點擊連結即可登入。",
|
|
884
|
-
"sendAnother": "重新發送連結"
|
|
844
|
+
"sendAnother": "重新發送連結",
|
|
845
|
+
"tryDifferentEmail": "使用其他信箱"
|
|
885
846
|
},
|
|
886
847
|
"sso": { "submit": "使用 SSO 繼續" },
|
|
887
848
|
"phoneOtp": {
|
|
@@ -907,22 +868,14 @@ var ui_default = {
|
|
|
907
868
|
"verify": "驗證",
|
|
908
869
|
"verifying": "驗證中...",
|
|
909
870
|
"resendIn": "{{seconds}}秒後重發",
|
|
910
|
-
"invalid": "驗證碼無效"
|
|
911
|
-
"expired": "驗證碼已過期"
|
|
871
|
+
"invalid": "驗證碼無效"
|
|
912
872
|
},
|
|
913
873
|
"error": {
|
|
914
|
-
"title": "認證錯誤",
|
|
915
|
-
"genericMessage": "認證過程中發生錯誤",
|
|
916
|
-
"tryAgain": "重試",
|
|
917
|
-
"oauthFailed": "OAuth 認證失敗",
|
|
918
|
-
"ssoDomainFailed": "網域驗證失敗",
|
|
919
|
-
"sessionExpired": "工作階段已過期,請重試",
|
|
920
874
|
"accessDenied": "存取被拒絕,請重試",
|
|
921
|
-
"
|
|
922
|
-
"
|
|
923
|
-
"
|
|
924
|
-
"
|
|
925
|
-
"generic": "認證錯誤,請重試。"
|
|
875
|
+
"invalidRequest": "無效請求,請重試",
|
|
876
|
+
"unauthorizedClient": "未授權的用戶端,請聯繫支援",
|
|
877
|
+
"serverError": "伺服器錯誤,請稍後再試",
|
|
878
|
+
"generic": "認證錯誤,請重試"
|
|
926
879
|
},
|
|
927
880
|
"password": {
|
|
928
881
|
"weak": "弱",
|
|
@@ -954,23 +907,13 @@ var ui_default = {
|
|
|
954
907
|
"featureAudit": "完整稽核日誌",
|
|
955
908
|
"errors": {
|
|
956
909
|
"invalidCredentials": "電子郵件或密碼錯誤",
|
|
957
|
-
"
|
|
958
|
-
"emailInvalid": "請輸入有效的電子郵件地址",
|
|
959
|
-
"passwordRequired": "請輸入密碼",
|
|
960
|
-
"passwordMin": "密碼至少需要8個字元",
|
|
961
|
-
"passwordMax": "密碼不能超過128個字元",
|
|
962
|
-
"passwordMismatch": "兩次輸入的密碼不一致",
|
|
963
|
-
"nameRequired": "請輸入姓名",
|
|
964
|
-
"nameMax": "姓名不能超過100個字元",
|
|
965
|
-
"codeRequired": "請輸入驗證碼",
|
|
966
|
-
"codeInvalid": "驗證碼必須是6位數字",
|
|
967
|
-
"codeDigitsOnly": "驗證碼只能包含數字",
|
|
968
|
-
"backupCodeRequired": "請輸入備用碼",
|
|
910
|
+
"codeInvalid": "驗證碼無效",
|
|
969
911
|
"backupCodeInvalid": "無效的備用碼",
|
|
970
912
|
"emailRequiredResend": "需要電子郵件地址才能重新發送驗證",
|
|
971
913
|
"generic": "發生錯誤"
|
|
972
914
|
}
|
|
973
|
-
}
|
|
915
|
+
},
|
|
916
|
+
captcha: { "loading": "正在載入驗證..." }
|
|
974
917
|
};
|
|
975
918
|
|
|
976
919
|
//#endregion
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { _ as WORKFLOWS_DIR, c as FILE_EXT, s as EVENTS_DIR, t as APPOS_DIR } from "./constants-BicCnEiJ.mjs";
|
|
2
2
|
import z$1, { z } from "zod";
|
|
3
3
|
import { lt, sql } from "drizzle-orm";
|
|
4
4
|
import { pgTable } from "drizzle-orm/pg-core";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { d as loadMiddleware, f as ui_default$2, m as ui_default, o as loadAndRegisterAPIRoutes, p as ui_default$1 } from "./openapi-
|
|
1
|
+
import { f as MIDDLEWARE_DIR, g as WEB_DIR, o as DESIGN_SYSTEM_PATH, p as PUBLIC_DIR, r as BUILD_OUTPUT_DIR, t as APPOS_DIR } from "./constants-BicCnEiJ.mjs";
|
|
2
|
+
import { d as loadMiddleware, f as ui_default$2, m as ui_default, o as loadAndRegisterAPIRoutes, p as ui_default$1 } from "./openapi-uisUTLq7.mjs";
|
|
3
3
|
import { t as instrumentation_exports } from "./instrumentation-DkoLNAtz.mjs";
|
|
4
4
|
import { a as appLoadContext } from "./ssr-BsfNjYlJ.mjs";
|
|
5
5
|
import { toNodeHandler } from "better-auth/node";
|
|
@@ -410,6 +410,10 @@ async function defineServer({ container }) {
|
|
|
410
410
|
});
|
|
411
411
|
app.all(`${container.auth.options.basePath}/*`, toNodeHandler(container.auth));
|
|
412
412
|
await loadAndRegisterAPIRoutes(app);
|
|
413
|
+
if (process.env.NODE_ENV === "production") {
|
|
414
|
+
const storybookBuildPath = join(BUILD_OUTPUT_DIR, "storybook");
|
|
415
|
+
if (existsSync(storybookBuildPath)) app.use(DESIGN_SYSTEM_PATH, express.static(storybookBuildPath, { maxAge: "1h" }));
|
|
416
|
+
}
|
|
413
417
|
if (process.env.NODE_ENV === "production" ? existsSync(join(BUILD_OUTPUT_DIR, "server/index.js")) : existsSync(join(process.cwd(), WEB_DIR))) {
|
|
414
418
|
const { defineAppContext } = await import("./app-context-B1VJ9qnH.mjs");
|
|
415
419
|
if (process.env.NODE_ENV === "production") {
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { buildQueries, clearAllMocks, configure, createEvent, expect, findAllByAltText, findAllByDisplayValue, findAllByLabelText, findAllByPlaceholderText, findAllByRole, findAllByTestId, findAllByText, findAllByTitle, findByAltText, findByDisplayValue, findByLabelText, findByPlaceholderText, findByRole, findByTestId, findByText, findByTitle, fireEvent, fn, getAllByAltText, getAllByDisplayValue, getAllByLabelText, getAllByPlaceholderText, getAllByRole, getAllByTestId, getAllByText, getAllByTitle, getByAltText, getByDisplayValue, getByLabelText, getByPlaceholderText, getByRole, getByTestId, getByText, getByTitle, getConfig, getDefaultNormalizer, getElementError, getNodeText, getQueriesForElement, getRoles, getSuggestedQuery, isInaccessible, isMockFunction, logDOM, logRoles, onMockCall, prettyDOM, prettyFormat, queries, queryAllByAltText, queryAllByAttribute, queryAllByDisplayValue, queryAllByLabelText, queryAllByPlaceholderText, queryAllByRole, queryAllByTestId, queryAllByText, queryAllByTitle, queryByAltText, queryByAttribute, queryByDisplayValue, queryByLabelText, queryByPlaceholderText, queryByRole, queryByTestId, queryByText, queryByTitle, queryHelpers, resetAllMocks, restoreAllMocks, screen, spyOn, uninstrumentedUserEvent, userEvent, waitFor, waitForElementToBeRemoved, within } from "storybook/test";
|
|
2
|
+
import { AddMocks, ArgTypes, Args, Meta, Meta as Meta$1, StoryObj, StrictArgs } from "@storybook/react";
|
|
3
|
+
import { ComponentType } from "react";
|
|
4
|
+
|
|
5
|
+
//#region src/storybook/index.d.ts
|
|
6
|
+
/**
|
|
7
|
+
* Creates Storybook meta configuration with sensible defaults.
|
|
8
|
+
* Auto-adds autodocs tag, centered layout, and "App/" title prefix.
|
|
9
|
+
*
|
|
10
|
+
* @example
|
|
11
|
+
* ```tsx
|
|
12
|
+
* // web/components/feature-card.stories.tsx
|
|
13
|
+
* import { defineMeta } from "appos/storybook";
|
|
14
|
+
* import { FeatureCard } from "./feature-card";
|
|
15
|
+
*
|
|
16
|
+
* export default defineMeta(FeatureCard);
|
|
17
|
+
*
|
|
18
|
+
* export const Default = { args: { title: "Feature" } };
|
|
19
|
+
* export const WithIcon = { args: { title: "Feature", icon: <IconStar /> } };
|
|
20
|
+
* ```
|
|
21
|
+
*
|
|
22
|
+
* @example
|
|
23
|
+
* ```tsx
|
|
24
|
+
* // With custom title and layout
|
|
25
|
+
* import { defineMeta } from "appos/storybook";
|
|
26
|
+
*
|
|
27
|
+
* export default defineMeta(HeroSection, {
|
|
28
|
+
* title: "Marketing/Hero", // Custom path (no auto-prefix)
|
|
29
|
+
* layout: "fullscreen",
|
|
30
|
+
* });
|
|
31
|
+
*
|
|
32
|
+
* export const Default = { args: { headline: "Welcome" } };
|
|
33
|
+
* ```
|
|
34
|
+
*/
|
|
35
|
+
declare function defineMeta<T extends ComponentType<any>>(Component: T, options?: {
|
|
36
|
+
/** Story title. Auto-prefixed with "App/" unless contains "/" */title?: string; /** Layout mode. Defaults to "centered" */
|
|
37
|
+
layout?: "centered" | "fullscreen" | "padded";
|
|
38
|
+
}): Meta$1<T>;
|
|
39
|
+
//#endregion
|
|
40
|
+
export { type AddMocks, type ArgTypes, type Args, type Meta, type StoryObj, type StrictArgs, buildQueries, clearAllMocks, configure, createEvent, defineMeta, expect, findAllByAltText, findAllByDisplayValue, findAllByLabelText, findAllByPlaceholderText, findAllByRole, findAllByTestId, findAllByText, findAllByTitle, findByAltText, findByDisplayValue, findByLabelText, findByPlaceholderText, findByRole, findByTestId, findByText, findByTitle, fireEvent, fn, getAllByAltText, getAllByDisplayValue, getAllByLabelText, getAllByPlaceholderText, getAllByRole, getAllByTestId, getAllByText, getAllByTitle, getByAltText, getByDisplayValue, getByLabelText, getByPlaceholderText, getByRole, getByTestId, getByText, getByTitle, getConfig, getDefaultNormalizer, getElementError, getNodeText, getQueriesForElement, getRoles, getSuggestedQuery, isInaccessible, isMockFunction, logDOM, logRoles, onMockCall, prettyDOM, prettyFormat, queries, queryAllByAltText, queryAllByAttribute, queryAllByDisplayValue, queryAllByLabelText, queryAllByPlaceholderText, queryAllByRole, queryAllByTestId, queryAllByText, queryAllByTitle, queryByAltText, queryByAttribute, queryByDisplayValue, queryByLabelText, queryByPlaceholderText, queryByRole, queryByTestId, queryByText, queryByTitle, queryHelpers, resetAllMocks, restoreAllMocks, screen, spyOn, uninstrumentedUserEvent, userEvent, waitFor, waitForElementToBeRemoved, within };
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { buildQueries, clearAllMocks, configure, createEvent, expect, findAllByAltText, findAllByDisplayValue, findAllByLabelText, findAllByPlaceholderText, findAllByRole, findAllByTestId, findAllByText, findAllByTitle, findByAltText, findByDisplayValue, findByLabelText, findByPlaceholderText, findByRole, findByTestId, findByText, findByTitle, fireEvent, fn, getAllByAltText, getAllByDisplayValue, getAllByLabelText, getAllByPlaceholderText, getAllByRole, getAllByTestId, getAllByText, getAllByTitle, getByAltText, getByDisplayValue, getByLabelText, getByPlaceholderText, getByRole, getByTestId, getByText, getByTitle, getConfig, getDefaultNormalizer, getElementError, getNodeText, getQueriesForElement, getRoles, getSuggestedQuery, isInaccessible, isMockFunction, logDOM, logRoles, onMockCall, prettyDOM, prettyFormat, queries, queryAllByAltText, queryAllByAttribute, queryAllByDisplayValue, queryAllByLabelText, queryAllByPlaceholderText, queryAllByRole, queryAllByTestId, queryAllByText, queryAllByTitle, queryByAltText, queryByAttribute, queryByDisplayValue, queryByLabelText, queryByPlaceholderText, queryByRole, queryByTestId, queryByText, queryByTitle, queryHelpers, resetAllMocks, restoreAllMocks, screen, spyOn, uninstrumentedUserEvent, userEvent, waitFor, waitForElementToBeRemoved, within } from "storybook/test";
|
|
2
|
+
|
|
3
|
+
//#region src/storybook/index.ts
|
|
4
|
+
/**
|
|
5
|
+
* Creates Storybook meta configuration with sensible defaults.
|
|
6
|
+
* Auto-adds autodocs tag, centered layout, and "App/" title prefix.
|
|
7
|
+
*
|
|
8
|
+
* @example
|
|
9
|
+
* ```tsx
|
|
10
|
+
* // web/components/feature-card.stories.tsx
|
|
11
|
+
* import { defineMeta } from "appos/storybook";
|
|
12
|
+
* import { FeatureCard } from "./feature-card";
|
|
13
|
+
*
|
|
14
|
+
* export default defineMeta(FeatureCard);
|
|
15
|
+
*
|
|
16
|
+
* export const Default = { args: { title: "Feature" } };
|
|
17
|
+
* export const WithIcon = { args: { title: "Feature", icon: <IconStar /> } };
|
|
18
|
+
* ```
|
|
19
|
+
*
|
|
20
|
+
* @example
|
|
21
|
+
* ```tsx
|
|
22
|
+
* // With custom title and layout
|
|
23
|
+
* import { defineMeta } from "appos/storybook";
|
|
24
|
+
*
|
|
25
|
+
* export default defineMeta(HeroSection, {
|
|
26
|
+
* title: "Marketing/Hero", // Custom path (no auto-prefix)
|
|
27
|
+
* layout: "fullscreen",
|
|
28
|
+
* });
|
|
29
|
+
*
|
|
30
|
+
* export const Default = { args: { headline: "Welcome" } };
|
|
31
|
+
* ```
|
|
32
|
+
*/
|
|
33
|
+
function defineMeta(Component, options) {
|
|
34
|
+
return {
|
|
35
|
+
title: options?.title ? options.title.includes("/") ? options.title : `App/${options.title}` : `App/${Component.displayName || Component.name || "Component"}`,
|
|
36
|
+
component: Component,
|
|
37
|
+
tags: ["autodocs"],
|
|
38
|
+
parameters: { layout: options?.layout ?? "centered" }
|
|
39
|
+
};
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
//#endregion
|
|
43
|
+
export { buildQueries, clearAllMocks, configure, createEvent, defineMeta, expect, findAllByAltText, findAllByDisplayValue, findAllByLabelText, findAllByPlaceholderText, findAllByRole, findAllByTestId, findAllByText, findAllByTitle, findByAltText, findByDisplayValue, findByLabelText, findByPlaceholderText, findByRole, findByTestId, findByText, findByTitle, fireEvent, fn, getAllByAltText, getAllByDisplayValue, getAllByLabelText, getAllByPlaceholderText, getAllByRole, getAllByTestId, getAllByText, getAllByTitle, getByAltText, getByDisplayValue, getByLabelText, getByPlaceholderText, getByRole, getByTestId, getByText, getByTitle, getConfig, getDefaultNormalizer, getElementError, getNodeText, getQueriesForElement, getRoles, getSuggestedQuery, isInaccessible, isMockFunction, logDOM, logRoles, onMockCall, prettyDOM, prettyFormat, queries, queryAllByAltText, queryAllByAttribute, queryAllByDisplayValue, queryAllByLabelText, queryAllByPlaceholderText, queryAllByRole, queryAllByTestId, queryAllByText, queryAllByTitle, queryByAltText, queryByAttribute, queryByDisplayValue, queryByLabelText, queryByPlaceholderText, queryByRole, queryByTestId, queryByText, queryByTitle, queryHelpers, resetAllMocks, restoreAllMocks, screen, spyOn, uninstrumentedUserEvent, userEvent, waitFor, waitForElementToBeRemoved, within };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { O as App, R as AppContainer, n as index_d_exports } from "../index-
|
|
1
|
+
import { E as defineTestDatabase, b as DefineTestDatabaseOptions } from "../auth-BCOIpGDO.mjs";
|
|
2
|
+
import { O as App, R as AppContainer, n as index_d_exports } from "../index-CiuTp085.mjs";
|
|
3
3
|
import "../orm-CJrd147z.mjs";
|
|
4
4
|
import "../instrumentation-CFIspF8-.mjs";
|
|
5
5
|
import supertestOriginal from "supertest";
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import "../app-context-LF4QmPUC.mjs";
|
|
2
|
-
import "../constants-
|
|
3
|
-
import { v as defineTestDatabase } from "../openapi-
|
|
2
|
+
import "../constants-BicCnEiJ.mjs";
|
|
3
|
+
import { v as defineTestDatabase } from "../openapi-uisUTLq7.mjs";
|
|
4
4
|
import "../instrumentation-DkoLNAtz.mjs";
|
|
5
|
-
import { t as defineServer } from "../server-
|
|
5
|
+
import { t as defineServer } from "../server-CA4aI0U6.mjs";
|
|
6
6
|
import "../ssr-BsfNjYlJ.mjs";
|
|
7
7
|
import { t as mock_exports } from "../mock-2jMk5l3y.mjs";
|
|
8
8
|
import { join } from "node:path";
|
|
@@ -1,13 +1,29 @@
|
|
|
1
1
|
import { i18nextHMRPlugin } from "i18next-hmr/vite";
|
|
2
|
+
import { Logger, PluginOption } from "vite";
|
|
2
3
|
import babel from "vite-plugin-babel";
|
|
3
4
|
import { reactRouter } from "@react-router/dev/vite";
|
|
4
5
|
import tailwindcss from "@tailwindcss/vite";
|
|
5
6
|
import react from "@vitejs/plugin-react";
|
|
6
|
-
import { PluginOption } from "vite";
|
|
7
7
|
export * from "vite";
|
|
8
8
|
|
|
9
9
|
//#region src/vite/index.d.ts
|
|
10
|
-
|
|
10
|
+
/**
|
|
11
|
+
* Creates a Vite logger that filters out known deprecation warnings from plugins
|
|
12
|
+
* that haven't migrated to rolldown-vite's new API yet.
|
|
13
|
+
*
|
|
14
|
+
* @returns Vite logger with filtered warnings.
|
|
15
|
+
*
|
|
16
|
+
* @example
|
|
17
|
+
* ```typescript
|
|
18
|
+
* import { defineViteLogger } from "appos/vite";
|
|
19
|
+
*
|
|
20
|
+
* export default defineConfig({
|
|
21
|
+
* customLogger: defineViteLogger(),
|
|
22
|
+
* plugins: [viteAppOS({ command }), tailwindcss(), reactRouter()],
|
|
23
|
+
* });
|
|
24
|
+
* ```
|
|
25
|
+
*/
|
|
26
|
+
declare function defineViteLogger(): Logger;
|
|
11
27
|
/**
|
|
12
28
|
* Vite plugin that fixes SSR module resolution issues with Vitest.
|
|
13
29
|
*
|
|
@@ -35,4 +51,4 @@ interface ViteAppOSOptions {
|
|
|
35
51
|
*/
|
|
36
52
|
declare function viteAppOS(opts: ViteAppOSOptions): PluginOption[];
|
|
37
53
|
//#endregion
|
|
38
|
-
export { ViteAppOSOptions, babel, i18nextHMRPlugin, react, reactRouter, tailwindcss, viteAppOS, vitestSSRFix };
|
|
54
|
+
export { ViteAppOSOptions, babel, defineViteLogger, i18nextHMRPlugin, react, reactRouter, tailwindcss, viteAppOS, vitestSSRFix };
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { o as DESIGN_SYSTEM_PATH, p as PUBLIC_DIR, u as LOCALES_DIR } from "../constants-BicCnEiJ.mjs";
|
|
2
2
|
import { createRequire } from "node:module";
|
|
3
3
|
import { dirname, join } from "node:path";
|
|
4
4
|
import { i18nextHMRPlugin, i18nextHMRPlugin as i18nextHMRPlugin$1 } from "i18next-hmr/vite";
|
|
5
|
+
import { createLogger } from "vite";
|
|
5
6
|
import babel from "vite-plugin-babel";
|
|
6
7
|
import { reactRouter } from "@react-router/dev/vite";
|
|
7
8
|
import tailwindcss from "@tailwindcss/vite";
|
|
@@ -10,6 +11,31 @@ import react from "@vitejs/plugin-react";
|
|
|
10
11
|
export * from "vite"
|
|
11
12
|
|
|
12
13
|
//#region src/vite/index.ts
|
|
14
|
+
/**
|
|
15
|
+
* Creates a Vite logger that filters out known deprecation warnings from plugins
|
|
16
|
+
* that haven't migrated to rolldown-vite's new API yet.
|
|
17
|
+
*
|
|
18
|
+
* @returns Vite logger with filtered warnings.
|
|
19
|
+
*
|
|
20
|
+
* @example
|
|
21
|
+
* ```typescript
|
|
22
|
+
* import { defineViteLogger } from "appos/vite";
|
|
23
|
+
*
|
|
24
|
+
* export default defineConfig({
|
|
25
|
+
* customLogger: defineViteLogger(),
|
|
26
|
+
* plugins: [viteAppOS({ command }), tailwindcss(), reactRouter()],
|
|
27
|
+
* });
|
|
28
|
+
* ```
|
|
29
|
+
*/
|
|
30
|
+
function defineViteLogger() {
|
|
31
|
+
const logger = createLogger();
|
|
32
|
+
const originalWarn = logger.warn.bind(logger);
|
|
33
|
+
logger.warn = (msg, options) => {
|
|
34
|
+
if (msg.includes("optimizeDeps.esbuildOptions") && msg.includes("deprecated")) return;
|
|
35
|
+
originalWarn(msg, options);
|
|
36
|
+
};
|
|
37
|
+
return logger;
|
|
38
|
+
}
|
|
13
39
|
const require = createRequire(import.meta.url);
|
|
14
40
|
/**
|
|
15
41
|
* Vite plugin that fixes SSR module resolution issues with Vitest.
|
|
@@ -48,15 +74,15 @@ function viteAppOS(opts) {
|
|
|
48
74
|
return [
|
|
49
75
|
{
|
|
50
76
|
name: "appos-auth-routes",
|
|
51
|
-
resolveId(id) {
|
|
52
|
-
if (id.startsWith("appos:auth/")) return `\0${id}`;
|
|
53
|
-
},
|
|
54
77
|
load(id) {
|
|
55
78
|
if (id.startsWith("\0appos:auth/")) {
|
|
56
79
|
const routeFile = id.slice(12);
|
|
57
80
|
return `export * from "appos/web/routes/auth/${routeFile}";
|
|
58
81
|
export { default } from "appos/web/routes/auth/${routeFile}";`;
|
|
59
82
|
}
|
|
83
|
+
},
|
|
84
|
+
resolveId(id) {
|
|
85
|
+
if (id.startsWith("appos:auth/")) return `\0${id}`;
|
|
60
86
|
}
|
|
61
87
|
},
|
|
62
88
|
...opts.command === "serve" ? [i18nextHMRPlugin$1({ localesDir: `./${join(PUBLIC_DIR, LOCALES_DIR)}` })] : [],
|
|
@@ -69,14 +95,64 @@ export { default } from "appos/web/routes/auth/${routeFile}";`;
|
|
|
69
95
|
},
|
|
70
96
|
babel({
|
|
71
97
|
babelConfig: {
|
|
98
|
+
compact: opts.command === "build",
|
|
72
99
|
presets: [require.resolve("@babel/preset-typescript")],
|
|
73
100
|
plugins: [[require.resolve("babel-plugin-react-compiler"), { target: "19" }]]
|
|
74
101
|
},
|
|
75
102
|
filter: /\.[jt]sx?$/,
|
|
76
103
|
loader: (path$1) => path$1.endsWith(".tsx") || path$1.endsWith(".jsx") ? "jsx" : "js"
|
|
77
|
-
})
|
|
104
|
+
}),
|
|
105
|
+
...opts.command === "serve" ? [{
|
|
106
|
+
name: "vite-plugin-appos-storybook-embed",
|
|
107
|
+
configureServer(server) {
|
|
108
|
+
server.middlewares.use((req, res, next) => {
|
|
109
|
+
if (req.url?.startsWith(DESIGN_SYSTEM_PATH)) {
|
|
110
|
+
res.setHeader("Content-Type", "text/html");
|
|
111
|
+
res.end(`<!DOCTYPE html>
|
|
112
|
+
<html lang="en">
|
|
113
|
+
<head>
|
|
114
|
+
<meta charset="UTF-8">
|
|
115
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
116
|
+
<link rel="icon" href="/favicon.ico" />
|
|
117
|
+
<title>${process.env.APP_NAME || "AppOS"} Design System</title>
|
|
118
|
+
<style>
|
|
119
|
+
* { margin: 0; padding: 0; box-sizing: border-box; }
|
|
120
|
+
html, body { height: 100%; }
|
|
121
|
+
iframe { width: 100%; height: 100%; border: none; }
|
|
122
|
+
</style>
|
|
123
|
+
</head>
|
|
124
|
+
<body>
|
|
125
|
+
<iframe id="storybook" src="http://localhost:6006/"></iframe>
|
|
126
|
+
<script>
|
|
127
|
+
(() => {
|
|
128
|
+
const iframe = document.getElementById('storybook');
|
|
129
|
+
const path = new URLSearchParams(window.location.search).get('path');
|
|
130
|
+
if (path) iframe.src = 'http://localhost:6006/?path=' + encodeURIComponent(path);
|
|
131
|
+
|
|
132
|
+
window.addEventListener('message', (e) => {
|
|
133
|
+
if (e.origin !== 'http://localhost:6006') return;
|
|
134
|
+
if (e.data?.type === 'storybook-navigation') {
|
|
135
|
+
const url = new URL(window.location);
|
|
136
|
+
if (e.data.path) {
|
|
137
|
+
url.searchParams.set('path', e.data.path);
|
|
138
|
+
} else {
|
|
139
|
+
url.searchParams.delete('path');
|
|
140
|
+
}
|
|
141
|
+
window.history.replaceState({}, '', url);
|
|
142
|
+
}
|
|
143
|
+
});
|
|
144
|
+
})();
|
|
145
|
+
<\/script>
|
|
146
|
+
</body>
|
|
147
|
+
</html>`);
|
|
148
|
+
return;
|
|
149
|
+
}
|
|
150
|
+
next();
|
|
151
|
+
});
|
|
152
|
+
}
|
|
153
|
+
}] : []
|
|
78
154
|
];
|
|
79
155
|
}
|
|
80
156
|
|
|
81
157
|
//#endregion
|
|
82
|
-
export { babel, i18nextHMRPlugin, react, reactRouter, tailwindcss, viteAppOS, vitestSSRFix };
|
|
158
|
+
export { babel, defineViteLogger, i18nextHMRPlugin, react, reactRouter, tailwindcss, viteAppOS, vitestSSRFix };
|