@realtimex/email-automator 2.2.0 → 2.2.1
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/api/server.ts +0 -6
- package/api/src/config/index.ts +3 -0
- package/bin/email-automator-setup.js +2 -3
- package/bin/email-automator.js +23 -7
- package/package.json +1 -2
- package/src/App.tsx +0 -622
- package/src/components/AccountSettings.tsx +0 -310
- package/src/components/AccountSettingsPage.tsx +0 -390
- package/src/components/Configuration.tsx +0 -1345
- package/src/components/Dashboard.tsx +0 -940
- package/src/components/ErrorBoundary.tsx +0 -71
- package/src/components/LiveTerminal.tsx +0 -308
- package/src/components/LoadingSpinner.tsx +0 -39
- package/src/components/Login.tsx +0 -371
- package/src/components/Logo.tsx +0 -57
- package/src/components/SetupWizard.tsx +0 -388
- package/src/components/Toast.tsx +0 -109
- package/src/components/migration/MigrationBanner.tsx +0 -97
- package/src/components/migration/MigrationModal.tsx +0 -458
- package/src/components/migration/MigrationPulseIndicator.tsx +0 -38
- package/src/components/mode-toggle.tsx +0 -24
- package/src/components/theme-provider.tsx +0 -72
- package/src/components/ui/alert.tsx +0 -66
- package/src/components/ui/button.tsx +0 -57
- package/src/components/ui/card.tsx +0 -75
- package/src/components/ui/dialog.tsx +0 -133
- package/src/components/ui/input.tsx +0 -22
- package/src/components/ui/label.tsx +0 -24
- package/src/components/ui/otp-input.tsx +0 -184
- package/src/context/AppContext.tsx +0 -422
- package/src/context/MigrationContext.tsx +0 -53
- package/src/context/TerminalContext.tsx +0 -31
- package/src/core/actions.ts +0 -76
- package/src/core/auth.ts +0 -108
- package/src/core/intelligence.ts +0 -76
- package/src/core/processor.ts +0 -112
- package/src/hooks/useRealtimeEmails.ts +0 -111
- package/src/index.css +0 -140
- package/src/lib/api-config.ts +0 -42
- package/src/lib/api-old.ts +0 -228
- package/src/lib/api.ts +0 -421
- package/src/lib/migration-check.ts +0 -264
- package/src/lib/sounds.ts +0 -120
- package/src/lib/supabase-config.ts +0 -117
- package/src/lib/supabase.ts +0 -28
- package/src/lib/types.ts +0 -166
- package/src/lib/utils.ts +0 -6
- package/src/main.tsx +0 -10
package/api/server.ts
CHANGED
|
@@ -109,12 +109,6 @@ const server = app.listen(config.port, () => {
|
|
|
109
109
|
if (getServerSupabase()) {
|
|
110
110
|
startScheduler();
|
|
111
111
|
}
|
|
112
|
-
|
|
113
|
-
// Automatically open browser unless -n flag is provided
|
|
114
|
-
if (!config.noUi) {
|
|
115
|
-
const startCommand = process.platform === 'darwin' ? 'open' : process.platform === 'win32' ? 'start' : 'xdg-open';
|
|
116
|
-
spawn(startCommand, [url], { detached: true }).unref();
|
|
117
|
-
}
|
|
118
112
|
});
|
|
119
113
|
|
|
120
114
|
// Handle server errors
|
package/api/src/config/index.ts
CHANGED
|
@@ -2,6 +2,9 @@ import dotenv from 'dotenv';
|
|
|
2
2
|
import { fileURLToPath } from 'url';
|
|
3
3
|
import { dirname, join } from 'path';
|
|
4
4
|
|
|
5
|
+
// 1. Try to load from current working directory (e.g. where npx is run)
|
|
6
|
+
dotenv.config({ path: join(process.cwd(), '.env') });
|
|
7
|
+
// 2. Fallback to package root
|
|
5
8
|
dotenv.config();
|
|
6
9
|
|
|
7
10
|
const __filename = fileURLToPath(import.meta.url);
|
|
@@ -30,9 +30,8 @@ async function setup() {
|
|
|
30
30
|
console.log('========================');
|
|
31
31
|
console.log('');
|
|
32
32
|
|
|
33
|
-
const envPath = join(
|
|
34
|
-
|
|
35
|
-
|
|
33
|
+
const envPath = join(process.cwd(), '.env');
|
|
34
|
+
|
|
36
35
|
// Check if .env already exists
|
|
37
36
|
if (existsSync(envPath)) {
|
|
38
37
|
const overwrite = await question('⚠️ .env file already exists. Overwrite? (y/N): ');
|
package/bin/email-automator.js
CHANGED
|
@@ -5,9 +5,10 @@
|
|
|
5
5
|
* Main command to run the Email Automator API server
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
|
-
import { spawn } from 'child_process';
|
|
8
|
+
import { spawn, execSync } from 'child_process';
|
|
9
9
|
import { fileURLToPath } from 'url';
|
|
10
10
|
import { dirname, join } from 'path';
|
|
11
|
+
import { existsSync } from 'fs';
|
|
11
12
|
|
|
12
13
|
const __filename = fileURLToPath(import.meta.url);
|
|
13
14
|
const __dirname = dirname(__filename);
|
|
@@ -24,7 +25,7 @@ if (portIndex !== -1 && args[portIndex + 1]) {
|
|
|
24
25
|
|
|
25
26
|
const noUi = args.includes('--no-ui');
|
|
26
27
|
|
|
27
|
-
console.log('🚀
|
|
28
|
+
console.log('🚀 Email Automator starting...');
|
|
28
29
|
console.log(`📡 Port: ${port}`);
|
|
29
30
|
if (noUi) console.log('🖥️ Mode: No-UI');
|
|
30
31
|
console.log('');
|
|
@@ -32,12 +33,27 @@ console.log('');
|
|
|
32
33
|
// Path to server
|
|
33
34
|
const serverPath = join(__dirname, '..', 'api', 'server.ts');
|
|
34
35
|
|
|
35
|
-
//
|
|
36
|
-
|
|
37
|
-
//
|
|
38
|
-
const
|
|
36
|
+
// Robust tsx resolution
|
|
37
|
+
function getTsxPath() {
|
|
38
|
+
// 1. Try local node_modules
|
|
39
|
+
const localTsx = join(__dirname, '..', 'node_modules', '.bin', 'tsx');
|
|
40
|
+
if (existsSync(localTsx)) return localTsx;
|
|
39
41
|
|
|
40
|
-
//
|
|
42
|
+
// 2. Try to find in PATH
|
|
43
|
+
try {
|
|
44
|
+
const pathTsx = execSync(process.platform === 'win32' ? 'where tsx' : 'which tsx').toString().trim().split('\n')[0];
|
|
45
|
+
if (pathTsx) return pathTsx;
|
|
46
|
+
} catch (e) {
|
|
47
|
+
// which failed
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
// 3. Fallback to just 'tsx' and hope for the best
|
|
51
|
+
return 'tsx';
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
const tsxPath = getTsxPath();
|
|
55
|
+
|
|
56
|
+
// Start server
|
|
41
57
|
const server = spawn(tsxPath, [serverPath, ...args], {
|
|
42
58
|
stdio: 'inherit',
|
|
43
59
|
env: { ...process.env, PORT: port },
|
package/package.json
CHANGED