robodev 0.12.0 → 0.13.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 (155) hide show
  1. package/package.json +1 -1
  2. package/src/emit-starter.test.ts +14 -0
  3. package/src/index.ts +12 -4
  4. package/templates/auth-chat/.config/local.spa.template.yml +27 -0
  5. package/templates/auth-chat/.oxlint-base.json +29 -0
  6. package/templates/auth-chat/.oxlintrc.json +78 -0
  7. package/templates/auth-chat/.rulesync/rules/frontend-api-boundary.md +36 -0
  8. package/templates/auth-chat/.rulesync/rules/frontend-component-structure.md +38 -0
  9. package/templates/auth-chat/.rulesync/rules/frontend-forms.md +32 -0
  10. package/templates/auth-chat/.rulesync/rules/frontend-notifications.md +24 -0
  11. package/templates/auth-chat/.rulesync/rules/frontend-povio-components.md +42 -0
  12. package/templates/auth-chat/.rulesync/rules/frontend-povio-ui.md +45 -0
  13. package/templates/auth-chat/.rulesync/rules/frontend-query-autocomplete.md +29 -0
  14. package/templates/auth-chat/.rulesync/rules/frontend-tables-and-lists.md +34 -0
  15. package/templates/auth-chat/.rulesync/rules/frontend-translations.md +26 -0
  16. package/templates/auth-chat/.rulesync/rules/project-overview.md +32 -0
  17. package/templates/auth-chat/.rulesync/rules/robodev-api.md +30 -0
  18. package/templates/auth-chat/.rulesync/rules/robodev-auth.md +40 -0
  19. package/templates/auth-chat/.rulesync/rules/robodev-database.md +22 -0
  20. package/templates/auth-chat/.rulesync/rules/role-based-app-structure.md +36 -0
  21. package/templates/auth-chat/.rulesync/skills/media-feature/SKILL.md +21 -0
  22. package/templates/auth-chat/.rulesync/skills/povio-ui-styling/SKILL.md +208 -0
  23. package/templates/auth-chat/.rulesync/skills/povio-ui-styling/agents/openai.yaml +4 -0
  24. package/templates/auth-chat/.rulesync/skills/robodev-api-route/SKILL.md +13 -0
  25. package/templates/auth-chat/.rulesync/skills/robodev-table/SKILL.md +12 -0
  26. package/templates/auth-chat/README.md +26 -7
  27. package/templates/auth-chat/api/invite.ts +43 -0
  28. package/templates/auth-chat/apps/fe/index.html +24 -0
  29. package/templates/auth-chat/apps/fe/openapi-codegen.config.ts +37 -0
  30. package/templates/auth-chat/apps/fe/package.json +82 -0
  31. package/templates/auth-chat/apps/fe/public/apple-touch-icon.png +0 -0
  32. package/templates/auth-chat/apps/fe/public/favicon-96x96.png +0 -0
  33. package/templates/auth-chat/apps/fe/public/favicon.ico +0 -0
  34. package/templates/auth-chat/apps/fe/public/favicon.svg +3 -0
  35. package/templates/auth-chat/apps/fe/public/site.webmanifest +21 -0
  36. package/templates/auth-chat/apps/fe/public/web-app-manifest-192x192.png +0 -0
  37. package/templates/auth-chat/apps/fe/public/web-app-manifest-512x512.png +0 -0
  38. package/templates/auth-chat/apps/fe/src/assets/fonts/GeneralSans-Bold.otf +0 -0
  39. package/templates/auth-chat/apps/fe/src/assets/fonts/GeneralSans-Medium.otf +0 -0
  40. package/templates/auth-chat/apps/fe/src/assets/fonts/GeneralSans-Regular.otf +0 -0
  41. package/templates/auth-chat/apps/fe/src/assets/fonts/GeneralSans-Semibold.otf +0 -0
  42. package/templates/auth-chat/apps/fe/src/assets/locales/en/translation.json +202 -0
  43. package/templates/auth-chat/apps/fe/src/assets/locales/sl/translation.json +202 -0
  44. package/templates/auth-chat/apps/fe/src/clients/app-rest-client.ts +15 -0
  45. package/templates/auth-chat/apps/fe/src/clients/auth-token-store.ts +101 -0
  46. package/templates/auth-chat/apps/fe/src/clients/rest/app-error-handler.ts +31 -0
  47. package/templates/auth-chat/apps/fe/src/clients/rest/interceptors/authorization-header.interceptor.ts +15 -0
  48. package/templates/auth-chat/apps/fe/src/clients/rest/interceptors/refresh-token.interceptor.ts +37 -0
  49. package/templates/auth-chat/apps/fe/src/clients/rest/interceptors/response.interceptor.ts +17 -0
  50. package/templates/auth-chat/apps/fe/src/components/404.tsx +18 -0
  51. package/templates/auth-chat/apps/fe/src/components/features/auth/AuthBrandPanel.tsx +60 -0
  52. package/templates/auth-chat/apps/fe/src/components/features/auth/AuthLayout.tsx +23 -0
  53. package/templates/auth-chat/apps/fe/src/components/features/auth/LoginPage.tsx +111 -0
  54. package/templates/auth-chat/apps/fe/src/components/features/auth/RegisterPage.tsx +143 -0
  55. package/templates/auth-chat/apps/fe/src/components/features/chat/ChatPage.tsx +105 -0
  56. package/templates/auth-chat/apps/fe/src/components/features/chat/InviteForm.tsx +84 -0
  57. package/templates/auth-chat/apps/fe/src/components/features/profile/ProfilePage.tsx +96 -0
  58. package/templates/auth-chat/apps/fe/src/components/googleAnalytics/GoogleAnalytics.tsx +35 -0
  59. package/templates/auth-chat/apps/fe/src/components/layout/AppLayout.tsx +19 -0
  60. package/templates/auth-chat/apps/fe/src/components/layout/app-header/AppHeader.tsx +91 -0
  61. package/templates/auth-chat/apps/fe/src/components/layout/app-header/MobileNavigation.tsx +51 -0
  62. package/templates/auth-chat/apps/fe/src/components/layout/app-header/NavLink.tsx +29 -0
  63. package/templates/auth-chat/apps/fe/src/components/shared/branding/BrandLogo.tsx +13 -0
  64. package/templates/auth-chat/apps/fe/src/components/shared/error/ErrorFallback.tsx +43 -0
  65. package/templates/auth-chat/apps/fe/src/components/shared/error/ErrorText.tsx +20 -0
  66. package/templates/auth-chat/apps/fe/src/components/shared/error/NotFound.tsx +36 -0
  67. package/templates/auth-chat/apps/fe/src/components/shared/forms/RequiredLabel.tsx +21 -0
  68. package/templates/auth-chat/apps/fe/src/components/shared/forms/RowInputWrapper.tsx +50 -0
  69. package/templates/auth-chat/apps/fe/src/components/shared/head/AppHead.tsx +32 -0
  70. package/templates/auth-chat/apps/fe/src/components/shared/head/DefaultAppHead.tsx +34 -0
  71. package/templates/auth-chat/apps/fe/src/components/shared/layout/LoadingState.tsx +9 -0
  72. package/templates/auth-chat/apps/fe/src/components/shared/layout/ThinPageWrapper.tsx +5 -0
  73. package/templates/auth-chat/apps/fe/src/components/shared/page/PageHeader.tsx +69 -0
  74. package/templates/auth-chat/apps/fe/src/components/shared/ui/Card.tsx +60 -0
  75. package/templates/auth-chat/apps/fe/src/components/shared/ui/GoogleLoginButton.tsx +19 -0
  76. package/templates/auth-chat/apps/fe/src/components/shared/ui/RequiredLabel.tsx +22 -0
  77. package/templates/auth-chat/apps/fe/src/components/shared/ui/TableActions.tsx +22 -0
  78. package/templates/auth-chat/apps/fe/src/config/app.config.ts +35 -0
  79. package/templates/auth-chat/apps/fe/src/config/i18n.ts +43 -0
  80. package/templates/auth-chat/apps/fe/src/config/inits/a11y.ts +14 -0
  81. package/templates/auth-chat/apps/fe/src/config/inits/logger.ts +7 -0
  82. package/templates/auth-chat/apps/fe/src/config/inits/sentry.ts +21 -0
  83. package/templates/auth-chat/apps/fe/src/config/jwt.config.ts +2 -0
  84. package/templates/auth-chat/apps/fe/src/config/query.config.ts +20 -0
  85. package/templates/auth-chat/apps/fe/src/hooks/useAuth.ts +5 -0
  86. package/templates/auth-chat/apps/fe/src/main.tsx +52 -0
  87. package/templates/auth-chat/apps/fe/src/pages/(guest)/login.tsx +23 -0
  88. package/templates/auth-chat/apps/fe/src/pages/(guest)/register.tsx +23 -0
  89. package/templates/auth-chat/apps/fe/src/pages/(guest)/route.tsx +18 -0
  90. package/templates/auth-chat/apps/fe/src/pages/(private)/index.tsx +23 -0
  91. package/templates/auth-chat/apps/fe/src/pages/(private)/profile.tsx +23 -0
  92. package/templates/auth-chat/apps/fe/src/pages/(private)/route.tsx +18 -0
  93. package/templates/auth-chat/apps/fe/src/pages/(public)/auth.tsx +37 -0
  94. package/templates/auth-chat/apps/fe/src/pages/(public)/route.tsx +9 -0
  95. package/templates/auth-chat/apps/fe/src/pages/__root.tsx +164 -0
  96. package/templates/auth-chat/apps/fe/src/providers/AppErrorBoundary.tsx +10 -0
  97. package/templates/auth-chat/apps/fe/src/providers/OpenApiRuntimeProvider.tsx +31 -0
  98. package/templates/auth-chat/apps/fe/src/providers/index.tsx +44 -0
  99. package/templates/auth-chat/apps/fe/src/providers/jwt.provider.tsx +95 -0
  100. package/templates/auth-chat/apps/fe/src/routeTree.gen.ts +225 -0
  101. package/templates/auth-chat/apps/fe/src/styles/base.css +103 -0
  102. package/templates/auth-chat/apps/fe/src/styles/fonts/fonts.tsx +10 -0
  103. package/templates/auth-chat/apps/fe/src/styles/fonts/general-sans.css +31 -0
  104. package/templates/auth-chat/apps/fe/src/styles/globals.css +28 -0
  105. package/templates/auth-chat/apps/fe/src/styles/overrides/defaults/button.override.ts +536 -0
  106. package/templates/auth-chat/apps/fe/src/styles/overrides/defaults/checkbox.override.ts +71 -0
  107. package/templates/auth-chat/apps/fe/src/styles/overrides/defaults/input.override.ts +252 -0
  108. package/templates/auth-chat/apps/fe/src/styles/overrides/defaults/label.override.ts +91 -0
  109. package/templates/auth-chat/apps/fe/src/styles/overrides/defaults/modal.override.ts +57 -0
  110. package/templates/auth-chat/apps/fe/src/styles/overrides/defaults/radio.override.ts +46 -0
  111. package/templates/auth-chat/apps/fe/src/styles/overrides/defaults/table.override.ts +104 -0
  112. package/templates/auth-chat/apps/fe/src/styles/overrides/defaults/tag.override.ts +66 -0
  113. package/templates/auth-chat/apps/fe/src/styles/overrides/defaults/typography.override.ts +115 -0
  114. package/templates/auth-chat/apps/fe/src/styles/overrides/outline.clsx.ts +10 -0
  115. package/templates/auth-chat/apps/fe/src/styles/overrides/uiOverrides.override.ts +60 -0
  116. package/templates/auth-chat/apps/fe/src/styles/theme.css +2177 -0
  117. package/templates/auth-chat/apps/fe/src/types/i18next.d.ts +12 -0
  118. package/templates/auth-chat/apps/fe/src/types/table.d.ts +17 -0
  119. package/templates/auth-chat/apps/fe/src/types/ui.d.ts +26 -0
  120. package/templates/auth-chat/apps/fe/src/types/vite-env.d.ts +20 -0
  121. package/templates/auth-chat/apps/fe/src/utils/date.utils.ts +17 -0
  122. package/templates/auth-chat/apps/fe/src/utils/number.utils.ts +12 -0
  123. package/templates/auth-chat/apps/fe/src/utils/string.utils.ts +5 -0
  124. package/templates/auth-chat/apps/fe/src/vite-env.d.ts +1 -0
  125. package/templates/auth-chat/apps/fe/tsconfig.app.json +32 -0
  126. package/templates/auth-chat/apps/fe/tsconfig.json +9 -0
  127. package/templates/auth-chat/apps/fe/tsconfig.node.json +31 -0
  128. package/templates/auth-chat/apps/fe/vite.config.ts +94 -0
  129. package/templates/auth-chat/openapi.json +1016 -0
  130. package/templates/auth-chat/oxfmt.config.js +23 -0
  131. package/templates/auth-chat/package.json +6 -13
  132. package/templates/auth-chat/rulesync.jsonc +18 -0
  133. package/templates/auth-chat/tsconfig.json +2 -4
  134. package/templates/backend/README.md +2 -2
  135. package/templates/backend/api/_lib.ts +359 -0
  136. package/templates/backend/api/aliens/labels.ts +19 -0
  137. package/templates/backend/api/files/presigned-url.ts +48 -0
  138. package/templates/backend/api/files/upload.ts +29 -0
  139. package/templates/backend/api/planets/[id]/like.ts +36 -0
  140. package/templates/backend/api/planets/[id].ts +56 -13
  141. package/templates/backend/api/planets/paginate.ts +36 -0
  142. package/templates/backend/api/planets.ts +52 -44
  143. package/templates/backend/database.ts +33 -13
  144. package/templates/backend/package.json +1 -1
  145. package/templates/catalog.json +2 -2
  146. package/templates/empty/package.json +1 -1
  147. package/templates/space/package.json +1 -1
  148. package/templates/auth-chat/index.html +0 -201
  149. package/templates/auth-chat/src/main.tsx +0 -282
  150. package/templates/auth-chat/vite.config.ts +0 -7
  151. package/templates/backend/api/health.ts +0 -7
  152. package/templates/backend/api/launch.ts +0 -29
  153. package/templates/backend/api/me.ts +0 -14
  154. package/templates/backend/api/motto.ts +0 -9
  155. package/templates/backend/api/rockets.ts +0 -43
@@ -0,0 +1,12 @@
1
+ import "i18next";
2
+
3
+ import type { defaultNS, resources } from "@/config/i18n";
4
+
5
+ declare module "i18next" {
6
+ interface CustomTypeOptions {
7
+ enableSelector: true;
8
+ returnNull: false;
9
+ defaultNS: typeof defaultNS;
10
+ resources: (typeof resources)["en"];
11
+ }
12
+ }
@@ -0,0 +1,17 @@
1
+ /* oxlint-disable unused-imports/no-unused-vars */
2
+ import "@tanstack/react-table";
3
+
4
+ declare module "@tanstack/react-table" {
5
+ interface ColumnMeta<TData extends RowData, TValue> {
6
+ width?: string;
7
+ headerClass?: string;
8
+ cellClass?: string;
9
+ sortClass?: string;
10
+ }
11
+
12
+ interface CellContext<TData extends RowData, TValue> {
13
+ original: TData;
14
+ data: TData;
15
+ value: TValue;
16
+ }
17
+ }
@@ -0,0 +1,26 @@
1
+ import "@povio/ui";
2
+ import type { UIOverrides } from "@povio/ui";
3
+ import type { LinkProps } from "@tanstack/react-router";
4
+ import type { RowData } from "@tanstack/react-table";
5
+
6
+ import type { tableRowOverride } from "@/styles/overrides/defaults/table.override";
7
+ import type { typographyOverride } from "@/styles/overrides/defaults/typography.override";
8
+
9
+ declare module "@povio/ui" {
10
+ interface LinkNavigationProps extends LinkProps {}
11
+
12
+ interface TypographyVariantProps {
13
+ size?: UIOverrides.VariantProps<typeof typographyOverride>["size"];
14
+ sizeMobile?: UIOverrides.VariantProps<typeof typographyOverride>["sizeMobile"];
15
+ }
16
+
17
+ interface TableRowVariantProps {
18
+ rowSize?: UIOverrides.VariantProps<typeof tableRowOverride>["rowSize"];
19
+ }
20
+ }
21
+
22
+ declare module "@tanstack/react-table" {
23
+ interface ColumnMeta<TData extends RowData, TValue> {
24
+ filterKey?: string;
25
+ }
26
+ }
@@ -0,0 +1,20 @@
1
+ /// <reference types="vite/client" />
2
+
3
+ interface ImportMetaEnv {
4
+ readonly VITE_PUBLIC_ENABLE_WEB_VITALS: "true" | "false";
5
+ readonly VITE_PUBLIC_API_URL: string;
6
+ readonly VITE_PUBLIC_API_MODE?: "fake" | "real";
7
+ readonly VITE_PUBLIC_FAKE_BE_SEED_VERSION?: string;
8
+ readonly VITE_PUBLIC_LOG_LEVEL: "error" | "warn";
9
+ readonly VITE_PUBLIC_SENTRY_DSN: string;
10
+ readonly VITE_PUBLIC_SENTRY_ENVIRONMENT: string;
11
+ readonly VITE_PUBLIC_SENTRY_TRACES_SAMPLE_RATE: string;
12
+ readonly VITE_PUBLIC_SENTRY_REPLAYS_ON_ERROR_SAMPLE_RATE: string;
13
+ readonly VITE_PUBLIC_SENTRY_REPLAYS_SESSION_SAMPLE_RATE: string;
14
+ readonly VITE_PUBLIC_GOOGLE_ANALYTICS_MEASUREMENT_ID: string;
15
+ readonly VITE_PUBLIC_AUTH_CUSTOM_JWT_ENABLE_MAGIC_LINK: string;
16
+ }
17
+
18
+ interface ImportMeta {
19
+ readonly env: ImportMetaEnv;
20
+ }
@@ -0,0 +1,17 @@
1
+ import { DateUtils as PovioDateUtils } from "@povio/ui";
2
+
3
+ export namespace DateUtils {
4
+ export const parseDate = (date: string | Date): Date => (typeof date === "string" ? new Date(date) : date);
5
+
6
+ export const formatDate = (date: string | Date, format = "dd/MM/yyyy") => {
7
+ const parsedDate = parseDate(date);
8
+
9
+ return PovioDateUtils.formatDate(parsedDate, format);
10
+ };
11
+
12
+ export const formatDateTime = (date: string | Date, format = "dd/MM/yyyy HH:mm") => {
13
+ const parsedDate = parseDate(date);
14
+
15
+ return PovioDateUtils.formatDate(parsedDate, format);
16
+ };
17
+ }
@@ -0,0 +1,12 @@
1
+ export namespace NumberUtils {
2
+ export function formatNumber(value: number, options?: Intl.NumberFormatOptions): string {
3
+ return new Intl.NumberFormat(undefined, options).format(value);
4
+ }
5
+
6
+ export function formatInteger(value: number, options?: Intl.NumberFormatOptions): string {
7
+ return formatNumber(value, {
8
+ maximumFractionDigits: 0,
9
+ ...options,
10
+ });
11
+ }
12
+ }
@@ -0,0 +1,5 @@
1
+ export namespace StringUtils {
2
+ export function emptyToUndefined(value: string | null | undefined): string | undefined {
3
+ return value || undefined;
4
+ }
5
+ }
@@ -0,0 +1 @@
1
+ /// <reference types="vite/client" />
@@ -0,0 +1,32 @@
1
+ {
2
+ "compilerOptions": {
3
+ "tsBuildInfoFile": "./node_modules/.tmp/tsconfig.app.tsbuildinfo",
4
+ "target": "ES2022",
5
+ "useDefineForClassFields": true,
6
+ "lib": ["ES2022", "DOM", "DOM.Iterable"],
7
+ "module": "ESNext",
8
+ "types": ["vite/client", "node"],
9
+ "skipLibCheck": true,
10
+
11
+ /* Bundler mode */
12
+ "moduleResolution": "bundler",
13
+ "allowImportingTsExtensions": true,
14
+ "verbatimModuleSyntax": false,
15
+ "moduleDetection": "force",
16
+ "noEmit": true,
17
+ "jsx": "react-jsx",
18
+
19
+ /* Absolute imports */
20
+ "paths": {
21
+ "@/*": ["./src/*"]
22
+ },
23
+
24
+ /* Linting */
25
+ "strict": true,
26
+ "noUnusedLocals": true,
27
+ "noUnusedParameters": true,
28
+ "noFallthroughCasesInSwitch": true,
29
+ "noUncheckedSideEffectImports": true
30
+ },
31
+ "include": ["src", "node_modules/@povio/ui/dist/index.d.ts"]
32
+ }
@@ -0,0 +1,9 @@
1
+ {
2
+ "files": [],
3
+ "compilerOptions": {
4
+ "paths": {
5
+ "@/*": ["./src/*"]
6
+ }
7
+ },
8
+ "references": [{ "path": "./tsconfig.app.json" }, { "path": "./tsconfig.node.json" }]
9
+ }
@@ -0,0 +1,31 @@
1
+ {
2
+ "compilerOptions": {
3
+ "tsBuildInfoFile": "./node_modules/.tmp/tsconfig.node.tsbuildinfo",
4
+ "target": "ES2023",
5
+ "lib": ["ES2023"],
6
+ "module": "ESNext",
7
+ "types": ["node"],
8
+ "skipLibCheck": true,
9
+
10
+ /* Bundler mode */
11
+ "moduleResolution": "bundler",
12
+ "allowImportingTsExtensions": true,
13
+ "verbatimModuleSyntax": true,
14
+ "moduleDetection": "force",
15
+ "noEmit": true,
16
+
17
+ /* Absolute imports */
18
+ "paths": {
19
+ "@/*": ["./src/*"]
20
+ },
21
+
22
+ /* Linting */
23
+ "strict": true,
24
+ "noUnusedLocals": true,
25
+ "noUnusedParameters": true,
26
+ "erasableSyntaxOnly": true,
27
+ "noFallthroughCasesInSwitch": true,
28
+ "noUncheckedSideEffectImports": true
29
+ },
30
+ "include": ["vite.config.ts"]
31
+ }
@@ -0,0 +1,94 @@
1
+ import { applyEnv, resolveConfigSync, getNumber, getString } from "@povio/resolve-config";
2
+ import reactScan from "@povio/vite-plugin-react-scan";
3
+ import tailwindCSS from "@tailwindcss/vite";
4
+ import { devtools } from "@tanstack/devtools-vite";
5
+ import { tanstackRouter } from "@tanstack/router-plugin/vite";
6
+ import viteReact from "@vitejs/plugin-react";
7
+ import { defineConfig as defineViteConfig, mergeConfig } from "vite";
8
+ import devtoolsJson from "vite-plugin-devtools-json";
9
+ import { defineConfig as defineVitestConfig } from "vitest/config";
10
+ import { reactIconsSprite } from "react-icons-sprite/vite";
11
+
12
+ const repoRoot = new URL("../..", import.meta.url).pathname;
13
+ const env = resolveConfigSync({ cwd: repoRoot, module: "spa", target: "resolved" }) as any;
14
+
15
+ applyEnv(env, "__");
16
+
17
+ const isInTestMode = process.env.VITEST === "true";
18
+ const iconsSpritePlugin = reactIconsSprite();
19
+ const iconsSpriteTransform = iconsSpritePlugin.transform;
20
+
21
+ if (typeof iconsSpriteTransform === "function") {
22
+ iconsSpritePlugin.transform = function transformAppIcons(code, id, ...args) {
23
+ if (id.includes("/node_modules/")) {
24
+ return null;
25
+ }
26
+
27
+ return iconsSpriteTransform.call(this, code, id, ...args);
28
+ };
29
+ }
30
+
31
+ const createViteConfig = (isDevServer: boolean) => ({
32
+ plugins: [
33
+ isDevServer && reactScan(),
34
+ !isInTestMode &&
35
+ tanstackRouter({
36
+ target: "react",
37
+ autoCodeSplitting: true,
38
+ routesDirectory: "./src/pages",
39
+ }),
40
+ devtools({
41
+ eventBusConfig: { enabled: false },
42
+ }),
43
+ iconsSpritePlugin,
44
+ viteReact({
45
+ babel: {
46
+ plugins: ["babel-plugin-react-compiler"],
47
+ },
48
+ }),
49
+ tailwindCSS(),
50
+ !isInTestMode && devtoolsJson(),
51
+ ],
52
+ server: {
53
+ open: false,
54
+ port: getNumber(env, "VITE_DEV_PORT"),
55
+ strictPort: false,
56
+ proxy: {
57
+ "^/api(?:/|$)": {
58
+ target: getString(env, "VITE_PUBLIC_API_URL"),
59
+ changeOrigin: true,
60
+ secure: false,
61
+ },
62
+ },
63
+ },
64
+ build: {
65
+ target: "esnext",
66
+ },
67
+ optimizeDeps: {
68
+ entries: ["src/**/*.{ts,tsx}"],
69
+ },
70
+ worker: {
71
+ format: "es",
72
+ },
73
+ resolve: {
74
+ alias: {
75
+ "@": new URL("src", import.meta.url).pathname,
76
+ },
77
+ dedupe: ["react", "react-dom", "i18next", "react-i18next"],
78
+ tsconfigPaths: true,
79
+ },
80
+ });
81
+
82
+ const vitestConfig = defineVitestConfig({
83
+ test: {
84
+ root: "./",
85
+ include: ["src/**/*.test.{ts,tsx}"],
86
+ watch: false,
87
+ globals: true,
88
+ reporters: ["default"],
89
+ },
90
+ });
91
+
92
+ export default defineViteConfig(({ command }) =>
93
+ mergeConfig(createViteConfig(command === "serve"), vitestConfig),
94
+ );