@promakeai/cli 0.4.3 → 0.4.5

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.
@@ -1,132 +1,65 @@
1
- import path from "path";
2
- import tailwindcss from "@tailwindcss/vite";
3
- import react from "@vitejs/plugin-react";
4
- import { defineConfig, type Plugin } from "vite";
5
- import { inspectorDebugger } from "@promakeai/inspector/plugin";
6
-
7
- // Plugin: Restart dev server when new lang files are added
8
- function langWatchPlugin(): Plugin {
9
- return {
10
- name: "lang-watch",
11
- configureServer(server) {
12
- server.watcher.on("add", (file) => {
13
- const normalizedPath = file.replace(/\\/g, "/");
14
- const isModuleLang = normalizedPath.includes("/modules/") && normalizedPath.includes("/lang/");
15
- const isGlobalLang = normalizedPath.includes("/src/lang/");
16
-
17
- if ((isModuleLang || isGlobalLang) && file.endsWith(".json")) {
18
- console.log("\n🌐 New translation file detected!");
19
- console.log("šŸ”„ Restarting server to load translations...\n");
20
- server.restart();
21
- }
22
- });
23
- },
24
- };
25
- }
26
-
27
- // https://vite.dev/config/
28
- export default defineConfig(({ mode }) => ({
29
- plugins: [
30
- inspectorDebugger({ enabled: mode === "development" }),
31
- react(),
32
- tailwindcss(),
33
- mode === "development" && langWatchPlugin(),
34
- ].filter(Boolean),
35
- base: "/",
36
- resolve: {
37
- alias: {
38
- "@": path.resolve(__dirname, "./src"),
39
- },
40
- preserveSymlinks: true,
41
- },
42
- optimizeDeps: {
43
- include: [
44
- // Radix UI - CJS/ESM compatibility issues
45
- "@radix-ui/react-dropdown-menu",
46
- "@radix-ui/react-dialog",
47
- "@radix-ui/react-select",
48
- "@radix-ui/react-popover",
49
- "@radix-ui/react-tooltip",
50
- "@radix-ui/react-tabs",
51
- "@radix-ui/react-checkbox",
52
- "@radix-ui/react-accordion",
53
- "@radix-ui/react-alert-dialog",
54
- "@radix-ui/react-avatar",
55
- "@radix-ui/react-collapsible",
56
- "@radix-ui/react-context-menu",
57
- "@radix-ui/react-hover-card",
58
- "@radix-ui/react-label",
59
- "@radix-ui/react-menubar",
60
- "@radix-ui/react-navigation-menu",
61
- "@radix-ui/react-progress",
62
- "@radix-ui/react-radio-group",
63
- "@radix-ui/react-scroll-area",
64
- "@radix-ui/react-separator",
65
- "@radix-ui/react-slider",
66
- "@radix-ui/react-switch",
67
- "@radix-ui/react-toggle",
68
- "@radix-ui/react-toggle-group",
69
-
70
- // State management - ESM issues
71
- "@tanstack/react-query",
72
- "zustand",
73
-
74
- // Form libraries - external deps
75
- "react-hook-form",
76
- "@hookform/resolvers",
77
- "zod",
78
-
79
- // UI libraries - CJS/ESM mixed
80
- "cmdk",
81
- "vaul",
82
- "sonner",
83
-
84
- // Date libraries - CJS format
85
- "date-fns",
86
- "react-day-picker",
87
-
88
- // Charts - many sub-dependencies
89
- "recharts",
90
-
91
- // Carousel - external deps
92
- "embla-carousel-react",
93
-
94
- // HTTP client - CJS format
95
- "axios",
96
-
97
- // i18n - external deps
98
- "i18next",
99
- "react-i18next",
100
- "i18next-browser-languagedetector",
101
-
102
- // Animation - ESM issues
103
- "motion",
104
-
105
- // Database - WASM loader
106
- "sql.js",
107
- ],
108
- },
109
- server: {
110
- host: '0.0.0.0',
111
- allowedHosts: true,
112
- hmr: false,
113
- port: 5174,
114
- watch: {
115
- usePolling: true,
116
- interval: 500,
117
- },
118
- headers: {
119
- "Cache-Control": "no-cache, no-store, must-revalidate",
120
- },
121
- },
122
- preview: {
123
- port: 4173,
124
- },
125
- build: {
126
- rollupOptions: {
127
- output: {
128
- manualChunks: undefined,
129
- },
130
- },
131
- },
132
- }));
1
+ import path from "path";
2
+ import tailwindcss from "@tailwindcss/vite";
3
+ import react from "@vitejs/plugin-react";
4
+ import { defineConfig, type Plugin } from "vite";
5
+ import { inspectorDebugger } from "@promakeai/inspector/plugin";
6
+
7
+ // Plugin: Restart dev server when new lang files are added
8
+ function langWatchPlugin(): Plugin {
9
+ return {
10
+ name: "lang-watch",
11
+ configureServer(server) {
12
+ server.watcher.on("add", (file) => {
13
+ const normalizedPath = file.replace(/\\/g, "/");
14
+ const isModuleLang = normalizedPath.includes("/modules/") && normalizedPath.includes("/lang/");
15
+ const isGlobalLang = normalizedPath.includes("/src/lang/");
16
+
17
+ if ((isModuleLang || isGlobalLang) && file.endsWith(".json")) {
18
+ console.log("\n🌐 New translation file detected!");
19
+ console.log("šŸ”„ Restarting server to load translations...\n");
20
+ server.restart();
21
+ }
22
+ });
23
+ },
24
+ };
25
+ }
26
+
27
+ // https://vite.dev/config/
28
+ export default defineConfig(({ mode }) => ({
29
+ cacheDir: '/tmp/.vite-cache',
30
+ plugins: [
31
+ inspectorDebugger({ enabled: mode === "development" }),
32
+ react(),
33
+ tailwindcss(),
34
+ mode === "development" && langWatchPlugin(),
35
+ ].filter(Boolean),
36
+ resolve: {
37
+ alias: {
38
+ "@": path.resolve(__dirname, "./src"),
39
+ },
40
+ preserveSymlinks: true,
41
+ },
42
+ server: {
43
+ host: '0.0.0.0',
44
+ allowedHosts: true,
45
+ hmr: false,
46
+ port: 5174,
47
+ watch: {
48
+ usePolling: true,
49
+ interval: 500,
50
+ },
51
+ headers: {
52
+ "Cache-Control": "no-cache, no-store, must-revalidate",
53
+ },
54
+ },
55
+ preview: {
56
+ port: 4173,
57
+ },
58
+ build: {
59
+ rollupOptions: {
60
+ output: {
61
+ manualChunks: undefined,
62
+ },
63
+ },
64
+ },
65
+ }));